/**
 * Azdata Customer Dashboard Stylesheet
 * Responsive layout matching the dark slate design of the website
 */

.az-dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 15px;
    font-family: var(--az-font-sans), sans-serif;
    color: var(--az-text-light);
}

/* Sidebar Styling */
.az-dashboard-sidebar {
    background: var(--az-bg-card);
    border: 1px solid var(--az-border);
    border-radius: 16px;
    padding: 24px;
    height: fit-content;
}

.az-user-profile-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--az-border);
    margin-bottom: 24px;
}

.az-user-profile-summary img {
    border-radius: 50%;
    border: 2px solid var(--az-primary);
}

.az-user-info h4 {
    margin: 0 0 4px 0;
    color: var(--az-text-white);
    font-size: 1.1em;
    font-weight: 700;
}

.az-role-badge {
    display: inline-block;
    font-size: 0.78em;
    background: var(--az-primary-glow);
    color: var(--az-primary-light);
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}

.az-dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.az-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--az-text-light);
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.az-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--az-text-white);
}

.az-nav-item.active {
    background: var(--az-primary);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px var(--az-primary-glow);
}

.az-nav-item .az-count-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}

.az-logout-btn {
    margin-top: 15px;
    border-top: 1px solid var(--az-border);
    padding-top: 20px;
    color: #ef4444 !important;
}

.az-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Content Area */
.az-dashboard-main {
    min-width: 0; /* Prevents grid layout blowout */
}

.az-dashboard-tab-content {
    display: none;
    animation: azFadeIn 0.3s ease;
}

.az-dashboard-tab-content.active {
    display: block;
}

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

/* Dashboard Cards */
.az-welcome-banner {
    background: linear-gradient(135deg, var(--az-primary-dark) 0%, var(--az-bg-card) 100%);
    border: 1px solid var(--az-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
}

.az-welcome-banner h3 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 1.6em;
}

.az-welcome-banner p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
}

.az-dashboard-card {
    background: var(--az-bg-card);
    border: 1px solid var(--az-border);
    border-radius: 16px;
    padding: 30px;
}

.az-dashboard-card h3 {
    margin: 0 0 16px 0;
    color: var(--az-text-white);
    font-size: 1.3em;
}

.az-dashboard-card p.description {
    color: var(--az-text-muted);
    font-size: 0.9em;
    margin: -8px 0 20px 0;
}

/* Stats Grid */
.az-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.az-stat-card {
    background: var(--az-bg-card);
    border: 1px solid var(--az-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.az-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.az-stat-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.az-stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--az-primary-light); }
.az-stat-icon.gold { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.az-stat-data {
    display: flex;
    flex-direction: column;
}

.az-stat-label {
    font-size: 0.85em;
    color: var(--az-text-muted);
}

.az-stat-value {
    font-size: 1.6em;
    font-weight: 800;
    color: var(--az-text-white);
    margin: 4px 0;
}

.az-card-action {
    background: none;
    border: none;
    padding: 0;
    color: var(--az-primary-light);
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease;
}

.az-card-action:hover {
    color: var(--az-primary);
    text-decoration: underline;
}

/* Info Table */
.az-info-table {
    width: 100%;
    border-collapse: collapse;
}

.az-info-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--az-border);
}

.az-info-table tr:last-child td {
    border-bottom: none;
}

.az-info-table td:first-child {
    width: 200px;
    color: var(--az-text-muted);
}

.az-info-table td:last-child {
    color: var(--az-text-white);
}

/* Tables & Transactions */
.az-table-responsive {
    overflow-x: auto;
    width: 100%;
}

.az-tx-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.92em;
}

.az-tx-table th,
.az-tx-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--az-border);
}

.az-tx-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--az-text-white);
    font-weight: 600;
}

.az-tx-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.az-tx-note {
    color: var(--az-text-white);
    font-weight: 500;
}

.az-tx-ref {
    color: var(--az-text-muted);
}

/* Form Styles */
.az-dashboard-form {
    margin-top: 15px;
}

.az-form-row {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.az-form-row label {
    font-weight: 600;
    color: var(--az-text-white);
    font-size: 0.9em;
}

.az-form-row input[type="text"],
.az-form-row input[type="email"],
.az-form-row input[type="password"] {
    background: var(--az-bg-input);
    border: 1px solid var(--az-border);
    color: var(--az-text-white);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.95em;
    width: 100%;
    transition: all 0.2s ease;
}

.az-form-row input:focus {
    border-color: var(--az-primary);
    box-shadow: 0 0 0 2px var(--az-primary-glow);
    outline: none;
}

.az-form-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.az-form-alert.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--az-primary-light);
}

.az-form-alert.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* User Registration Card in Login state */
.az-dashboard-login-card {
    max-width: 450px;
    margin: 60px auto;
    background: var(--az-bg-card);
    border: 1px solid var(--az-border);
    border-radius: 16px;
    padding: 40px;
    font-family: var(--az-font-sans), sans-serif;
    color: var(--az-text-light);
}

.az-dashboard-login-card h3 {
    margin: 0 0 10px 0;
    color: var(--az-text-white);
    font-size: 1.5em;
}

.az-dashboard-login-card p {
    color: var(--az-text-muted);
    font-size: 0.92em;
    margin-bottom: 24px;
}

.az-dashboard-login-card form p {
    margin-bottom: 16px;
}

.az-dashboard-login-card form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.az-dashboard-login-card form input[type="text"],
.az-dashboard-login-card form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--az-bg-input);
    border: 1px solid var(--az-border);
    border-radius: 8px;
    color: #fff;
}

.az-dashboard-login-card form input[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--az-primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.az-dashboard-login-card form input[type="submit"]:hover {
    background: var(--az-primary-dark);
}

.az-reg-link {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
}

.az-reg-link a {
    color: var(--az-primary-light);
    text-decoration: none;
}

.az-reg-link a:hover {
    text-decoration: underline;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 768px) {
    .az-dashboard-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px auto;
    }
    
    .az-dashboard-sidebar {
        padding: 16px;
    }
    
    .az-user-profile-summary {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    
    .az-dashboard-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .az-nav-item {
        padding: 8px 12px;
        font-size: 0.88em;
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }
    
    .az-logout-btn {
        margin-top: 0;
        border-top: none;
        padding-top: 8px;
        flex: 1 1 100%;
    }
    
    .az-info-table td:first-child {
        width: 120px;
    }
}
