/* AutoMatch Pro - Frontend Dashboard Styles (Updated) */

.automatch-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Section - Updated Gradient */
.automatch-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, #000d9d 0%, #e40bff 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 13, 157, 0.15);
    flex-wrap: wrap;
    gap: 20px;
}

.user-info .welcome-message {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color:#fff;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0.9;
}

.user-details .username {
    font-weight: 500;
    font-size: 16px;
}

.user-details .email,
.user-details .member-since {
    font-size: 14px;
    opacity: 0.8;
}

/* Credits Display */
.credits-display {
    text-align: right;
}

.credits-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(15px);
    min-width: 180px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.credits-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shimmer 3s infinite;
}

.credits-amount {
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.credits-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.low-credits-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #fff3cd;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 10px;
}

.warning-icon {
    margin-right: 5px;
}

/* Statistics Cards - Only 4 cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 13, 157, 0.15);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #000d9d;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Action Buttons - Updated Colors */
.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.automatch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.automatch-btn-primary {
    background: linear-gradient(135deg, #000d9d 0%, #e40bff 100%);
    color: white;
}

.automatch-btn-primary:hover {
    background: linear-gradient(135deg, #000b80 0%, #c208db 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 13, 157, 0.3);
    color: white;
}

.automatch-btn-secondary {
    background: #48bb78;
    color: white;
}

.automatch-btn-secondary:hover {
    background: #38a169;
    color: white;
}

.automatch-btn-outline {
    background: transparent;
    color: #000d9d;
    border-color: #000d9d;
}

.automatch-btn-outline:hover {
    background: linear-gradient(135deg, #000d9d 0%, #e40bff 100%);
    color: white;
}

/* Recent Matches Section - Enhanced */
.dashboard-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    margin-bottom: 30px;
}

.section-title {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-count {
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: normal;
}

/* Match Items - Enhanced Student Info */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


.match-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border-left: 4px solid #000d9d;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.match-item:hover {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 8px 25px rgba(0, 13, 157, 0.1);
    transform: translateY(-2px);
}

.match-info {
    flex: 1;
}

.student-info .student-name {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.match-details {
    display: flex;
    gap: 15px;
    font-size: 14px;
    flex-wrap: wrap;
}

.language, .level, .age, .note {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    color: #475569;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.level {
    background: linear-gradient(135deg, #dcfdf4 0%, #a7f3d0 100%);
    color: #047857;
}

.age {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.note {
    background: #f7fafc;
    color: #4a5568;
    max-width: 200px;
}

.match-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.match-date strong {
    display: block;
    color: #333;
    font-size: 14px;
}

.match-date small {
    color: #666;
    font-size: 12px;
}

.credits-badge {
    background: #fed7d7;
    color: #c53030;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* No Matches State */
.no-matches {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-matches-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-matches h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.no-matches p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.encouragement {
    color: #000d9d !important;
    font-weight: 500;
}

/* Dashboard Footer */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.timestamp {
    font-weight: 500;
    color: #333;
}

.logout-link {
    color: #e53e3e;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
    color: #c53030;
}

/* Tabs */
.automatch-tabs-nav {
    display: flex;
    background: #f8fafc;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.automatch-tabs-nav .tab-link {
    flex: 1;
    padding: 12px 20px;
    text-decoration: none;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    min-width: 120px;
}
.automatch-tabs-nav .tab-link.active {
    background: linear-gradient(135deg, #000d9d 0%, #e40bff 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 13, 157, 0.3);
    transform: translateY(-1px);
}
.automatch-tabs-content .tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.automatch-tabs-content .tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Welcome Modal */
.automatch-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.automatch-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
}
.automatch-modal .modal-content {
    position: relative;
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    width: calc(100% - 40px);
    max-width: 560px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid #e2e8f0;
    direction: rtl !important;
}

/* Login Required State - Enhanced for Google Login */
.automatch-login-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px 20px;
}

.automatch-login-box {
    background: #fff;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0, 13, 157, 0.15);
    text-align: center;
    max-width: 450px;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.automatch-login-box h3 {
    margin: 0 0 15px 0;
    color: #000d9d;
    font-size: 28px;
    font-weight: 600;
}

.automatch-login-box p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
    font-size: 16px;
}

.login-subtitle {
    font-size: 14px !important;
    color: #999 !important;
    margin-bottom: 30px !important;
    font-style: italic;
}

.automatch-login-actions {
    margin-bottom: 30px;
}

/* Style the Nextend Social Login buttons */
.automatch-login-actions .nsl-container {
    margin: 0 auto;
}
div.nsl-container[data-align="left"] {
    text-align: center !important;
}

.automatch-login-actions .nsl-button {
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.automatch-login-actions .nsl-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Login Benefits Section */
.login-benefits {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.benefit-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.benefit-icon {
    font-size: 18px;
    opacity: 0.8;
}

.benefit-item span:last-child {
    font-weight: 500;
}

/* Error State */
.automatch-error {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .automatch-dashboard {
        padding: 15px;
    }
    
    .automatch-dashboard-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }
    
    .credits-display {
        text-align: center;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .dashboard-actions {
        flex-direction: column;
    }
    
    .automatch-btn {
        justify-content: center;
        width: 100%;
    }
    
    .match-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }
    
    .match-meta {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .dashboard-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .automatch-tabs-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        padding: 8px;
    }
    .automatch-tabs-nav .tab-link {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 100px;
    }
    
    /* Login box responsive */
    .automatch-login-required {
        min-height: 350px;
        padding: 20px 15px;
    }
    
    .automatch-login-box {
        padding: 30px 25px;
        max-width: 100%;
    }
    
    .automatch-login-box h3 {
        font-size: 24px;
    }
    
    .login-benefits {
        gap: 12px;
    }
    
    .benefit-item {
        font-size: 13px;
    }
    
    .automatch-login-actions .nsl-button {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}

/* RTL support */
[dir="rtl"] .automatch-dashboard { direction: rtl; }
[dir="rtl"] { text-align: right; }
[dir="rtl"] .automatch-dashboard-header { flex-direction: row-reverse; }
[dir="rtl"] .dashboard-actions { flex-direction: row-reverse; }
[dir="rtl"] .match-details { flex-direction: row-reverse; }
[dir="rtl"] .user-details { text-align: right; }
[dir="rtl"] .credits-display { text-align: left; }
[dir="rtl"] .section-title { flex-direction: row-reverse; }
[dir="rtl"] .match-item { border-left: none; border-right: 4px solid #000d9d; }
[dir="rtl"] * { font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif; }

/* Dark mode (optional) */
@media (prefers-color-scheme: dark) {
    .automatch-dashboard { background: #0f172a; color: #e2e8f0; }
    .stat-card { background: linear-gradient(145deg, #1e293b 0%, #334155 100%); border-color: #334155; }
    .match-item { background: linear-gradient(145deg, #1e293b 0%, #334155 100%); }
}
