/* Orders Management Styles */
.orders-page {
    padding: 100px 0 50px;
    min-height: 100vh;
}

.header-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Orders Container */
.orders-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Orders Tabs */
.orders-tabs {
    background: rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
}

.order-tab {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.order-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.order-tab.active {
    background: rgba(164, 80, 139, 0.3);
    border-color: var(--primary-light);
    box-shadow: 0 5px 15px rgba(164, 80, 139, 0.2);
}

.order-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-tab-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.order-tab-close {
    background: rgba(231, 76, 60, 0.3);
    border: none;
    color: #e74c3c;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.order-tab-close:hover {
    background: rgba(231, 76, 60, 0.5);
    transform: scale(1.1);
}

.order-tab-info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.order-tab-items {
    margin-top: 5px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.order-tab-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.order-tab-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Order Content */
.order-content {
    padding: 20px;
    overflow-y: auto;
}

.no-order-selected {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.no-order-selected i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Order Workspace */
.order-workspace {
    display: none;
    height: 100%;
}

.order-workspace.active {
    display: flex;
    flex-direction: column;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-title {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.order-actions {
    display: flex;
    gap: 10px;
}

/* Products Section */
.products-section {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    height: 100%;
}

.products-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.products-search {
    display: flex;
    gap: 10px;
    flex: 1;
}

.products-search input {
    flex: 1;
}

.products-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.product-item-small {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.product-item-small:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.product-item-small .product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: white;
}

.product-item-small .product-price {
    color: var(--primary-light);
    font-weight: 600;
}

.product-item-small .product-stock {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Cart Section */
.cart-section {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.cart-header {
    margin-bottom: 20px;
    text-align: center;
}

.cart-header h3 {
    margin: 0;
    color: white;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.cart-item-price {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.quantity-input {
    width: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    padding: 2px;
}

.cart-item-remove {
    color: #e74c3c;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.cart-summary {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.summary-row.total {
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
    margin-top: 10px;
}

.cart-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Products Modal */
.large-modal {
    max-width: 900px;
}

.products-modal-content {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.products-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.products-filters .search-box {
    flex: 1;
    min-width: 200px;
}

.products-filters .form-control {
    min-width: 150px;
}

.products-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 10px 0;
}

.product-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.product-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.product-card-image {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-image i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
}

.product-card-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: white;
    font-size: 0.9rem;
}

.product-card-price {
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 5px;
}

.product-card-stock {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Checkout Modal */
.order-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.change-display {
    margin-top: 8px;
    padding: 8px;
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 4px;
    color: #2ecc71;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .orders-container {
        grid-template-columns: 200px 1fr;
    }
    
    .products-section {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .orders-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .orders-tabs {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 200px;
    }
    
    .header-actions {
        flex-direction: column;
    }
    
    .products-filters {
        flex-direction: column;
    }
    
    .large-modal {
        margin: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .order-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .order-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .products-grid-small {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Animation for new tabs */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.order-tab {
    animation: slideInRight 0.3s ease;
}

/* Receipt Styles */
.medium-modal {
    max-width: 500px;
}

.receipt {
    background: white;
    color: #333;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.receipt-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px dashed #333;
}

.receipt-company {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
}

.receipt-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.receipt-info {
    margin-bottom: 15px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.receipt-label {
    font-weight: bold;
}

.receipt-items {
    margin: 15px 0;
    border-top: 1px dashed #333;
    border-bottom: 1px dashed #333;
    padding: 10px 0;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.receipt-item-name {
    flex: 2;
}

.receipt-item-qty {
    flex: 1;
    text-align: center;
}

.receipt-item-price {
    flex: 1;
    text-align: right;
}

.receipt-item-total {
    flex: 1;
    text-align: right;
    font-weight: bold;
}

.receipt-totals {
    margin: 15px 0;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 2px 0;
}

.receipt-total-row.grand-total {
    border-top: 2px solid #333;
    font-weight: bold;
    font-size: 16px;
    padding-top: 8px;
    margin-top: 8px;
}

.receipt-payment {
    margin: 15px 0;
    padding-top: 10px;
    border-top: 1px dashed #333;
}

.receipt-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed #333;
    font-size: 12px;
    color: #666;
}

/* Print Styles for Receipt */
@media print {
    body * {
        visibility: hidden;
    }
    
    .receipt, .receipt * {
        visibility: visible;
    }
    
    .receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        margin: 0;
        padding: 15px;
    }
    
    .modal-content {
        box-shadow: none;
        border: none;
    }
    
    .modal-footer {
        display: none !important;
    }
}

/* Receipt action buttons */
.receipt-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* QR Code for digital receipt */
.receipt-qr {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    border: 1px dashed #ccc;
}

.receipt-qr img {
    max-width: 150px;
    height: auto;
}
