// Dashboard Styles

// Box Sum Cards
.dashboard-card {
    background: white;
    border-left: 4px solid;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;

    &:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    }

    // Card title and subtitle colors
    .card-title-text {
        color: #5a5c69;
        font-weight: 600;
    }

    .card-subtitle-text {
        color: #858796;
    }

    .card-amount-text {
        color: #2e59d9;
        font-weight: 700;
    }

    .card-dropdown-toggle {
        color: #858796;
        
        &:hover {
            color: #5a5c69;
        }
    }

    // Primary Card (Blue)
    &.dashboard-card-primary {
        border-left-color: #4e73df;

        .card-amount-text {
            color: #4e73df;
        }

        .card-icon-primary {
            background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
            color: white;
        }

        .card-spinner-primary {
            color: #4e73df;
        }
    }

    // Success Card (Green)
    &.dashboard-card-success {
        border-left-color: #1cc88a;

        .card-amount-text {
            color: #1cc88a;
        }

        .card-icon-success {
            background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
            color: white;
        }

        .card-spinner-success {
            color: #1cc88a;
        }
    }

    // Warning Card (Orange)
    &.dashboard-card-warning {
        border-left-color: #f39c12;

        .card-amount-text {
            color: #f39c12;
        }

        .card-icon-warning {
            background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
            color: white;
        }

        .card-spinner-warning {
            color: #f39c12;
        }
    }

    // Info Card (Cyan)
    &.dashboard-card-info {
        border-left-color: #36b9cc;

        .card-amount-text {
            color: #36b9cc;
        }

        .card-icon-info {
            background: linear-gradient(135deg, #36b9cc 0%, #258391 100%);
            color: white;
        }

        .card-spinner-info {
            color: #36b9cc;
        }
    }

    .box-loading {
        // min-height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        // padding: 1rem 0;
    }

    .box-content {
        h5, h3 {
            font-weight: 600;
        }
        
        // min-height: 80px;
        display: flex;
        align-items: center;
    }

    .avatar-title {
        font-size: 24px;
    }

    // Dropdown in card
    .dropdown {
        .dropdown-toggle-nocaret {
            text-decoration: none;
            cursor: pointer;
            transition: opacity 0.2s;
            
            &:hover {
                opacity: 0.7;
            }
        }

        .dropdown-menu {
            min-width: 150px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

            .dropdown-item {
                padding: 0.5rem 1rem;
                font-size: 0.875rem;
                cursor: pointer;

                &:hover {
                    background-color: #f8f9fc;
                    color: #4e73df;
                }

                &:active {
                    background-color: #eaecf4;
                }
            }
        }
    }

    // Date inputs in card (กำหนดเอง)
    .box-date-from,
    .box-date-to {
        background-color: #f8f9fc !important;
        border: 1px solid #d1d3e2;
        color: #6e707e;
        font-size: 0.875rem;

        &::placeholder {
            color: #b7b9cc;
        }

        &:focus {
            background-color: white !important;
            border-color: #bac8f3;
            color: #6e707e;
            box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
        }
    }

    // Adjust spacing
    h2 small {
        font-size: 0.6em;
        font-weight: 400;
    }
}

// Chart Cards
.chart-container {
    position: relative;
    min-height: 300px;

    canvas {
        max-height: 300px;
    }
}

.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;

    .spinner-border {
        width: 3rem;
        height: 3rem;
    }
}

.chart-no-data {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;

    p {
        color: #6c757d;
        font-size: 1.1rem;
        margin: 0;
        padding: 2rem;
        text-align: center;
    }
}

// Order Table
.order-table {
    overflow: visible;
    
    table {
        margin-bottom: 0;
        width: 100%;
        table-layout: auto;

        thead th {
            background-color: #f8f9fa;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }

        tbody {
            tr {
                transition: all 0.2s ease;

                &:hover {
                    background-color: #f8f9fa;
                    transform: scale(1.01);
                }

                td {
                    vertical-align: middle;
                    
                    &:nth-child(2) {
                        // Order number column - allow wrap if needed
                        word-break: break-word;
                    }
                }
            }
        }
    }
}

.table-loading {
    padding: 3rem 0;
    display: flex;
    align-items: center;
    justify-content: center;

    .spinner-border {
        width: 3rem;
        height: 3rem;
    }
}

.table-no-data {
    padding: 3rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;

    p {
        color: #6c757d;
        font-size: 1.1rem;
        margin: 0;
    }
}

// Cards
.card {
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;

    .card-header {
        background-color: #fff;
        border-bottom: 1px solid #f0f0f0;
        padding: 1rem 1.5rem;

        .card-title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 0;
        }

        // Dropdown filter
        .dropdown {
            .card-drop {
                color: #6c757d;
                font-size: 20px;
                line-height: 1;
                padding: 0.25rem 0.5rem;
                display: inline-block;

                &:hover {
                    color: #495057;
                }
            }

            .dropdown-menu {
                min-width: 150px;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

                .dropdown-item {
                    padding: 0.5rem 1rem;
                    font-size: 0.9rem;
                    cursor: pointer;

                    &:hover {
                        background-color: #f8f9fa;
                        color: #0d6efd;
                    }

                    &:active {
                        background-color: #e9ecef;
                    }
                }
            }
        }
    }

    .card-body {
        padding: 1.5rem;
    }
}

// Responsive adjustments
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .chart-container {
        min-height: 250px;

        canvas {
            max-height: 250px;
        }
    }

    .order-table {
        max-height: 400px;
    }
}

// Animations
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

// Badge styles
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    font-size: 0.75rem;
}

// Remove custom scrollbar styles (not needed anymore)
