/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --primary-light: #a29bfe;
    --accent: #00cec9;
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --surface: #16213e;
    --text: #e8e8f0;
    --text-muted: #9a9ab0;
    --border: #2a2a4a;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 1.3rem;
    color: var(--primary-light);
}

.logo:hover {
    color: var(--primary-light);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-light);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* ===== Hero ===== */
.hero {
    padding: 140px 24px 80px;
    text-align: center;
    background: linear-gradient(180deg, rgba(108, 92, 231, 0.08) 0%, transparent 100%);
}

.hero-content {
    max-width: 680px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.highlight {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    position: relative;
    max-width: 480px;
    margin: 0 auto 32px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.stat strong {
    display: block;
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 2px;
}

/* ===== Tutors Section ===== */
.tutors-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: -0.5px;
}

.tutors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 60px 0;
}

/* ===== Tutor Card ===== */
.tutor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    position: relative;
    overflow: hidden;
}

.tutor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.25s;
}

.tutor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.tutor-card:hover::before {
    opacity: 1;
}

.card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    border: 3px solid var(--border);
    object-fit: cover;
    transition: border-color 0.25s;
}

.tutor-card:hover .card-avatar {
    border-color: var(--primary-light);
}

.card-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-rating {
    color: var(--warning);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.card-rating .rating-num {
    color: var(--text-muted);
    margin-left: 4px;
}

.card-specialty {
    display: inline-block;
    background: rgba(108, 92, 231, 0.15);
    color: var(--primary-light);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.card-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
}

.card-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.card-btn:hover {
    background: var(--primary-dark);
}

/* ===== About Section ===== */
.about-section {
    padding: 60px 24px 80px;
    background: linear-gradient(180deg, transparent 0%, rgba(108, 92, 231, 0.05) 100%);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
}

.about-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--primary-light);
}

.about-icon svg {
    width: 100%;
    height: 100%;
}

.about-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.about-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Modal Overlay ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 24px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    transform: translateY(30px) scale(0.96);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* Modal Header */
.modal-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.modal-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    flex-shrink: 0;
}

.modal-info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.modal-specialty {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.modal-status.online {
    color: var(--success);
}

.modal-status.offline {
    color: var(--danger);
}

/* Tabs */
.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    margin-bottom: 20px;
}

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

/* Overview Tab */
#tab-overview p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.7;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-item {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Skills Tab */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: rgba(108, 92, 231, 0.12);
    color: var(--primary-light);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

/* Reviews Tab */
.review-item {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

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

.review-author {
    font-weight: 600;
    font-size: 0.92rem;
}

.review-stars {
    color: var(--warning);
    font-size: 0.85rem;
}

.review-text {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Chat Section */
.chat-section {
    margin-bottom: 20px;
}

.chat-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.chat-messages {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    min-height: 100px;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.chat-placeholder {
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
    padding: 30px 0;
}

.chat-msg {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.chat-msg.user {
    align-items: flex-end;
}

.chat-msg.tutor {
    align-items: flex-start;
}

.chat-bubble {
    padding: 8px 14px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-msg.user .chat-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg.tutor .chat-bubble {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 3px;
    padding: 0 4px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

.chat-input-row input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-row input:focus {
    border-color: var(--primary);
}

.chat-send {
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send:hover {
    background: var(--primary-dark);
}

/* Get Help Button */
.get-help-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    letter-spacing: 0.3px;
}

.get-help-btn:hover {
    opacity: 0.9;
    transform: scale(1.01);
}

/* Confirmation Box */
.confirm-box {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    animation: fadeSlideUp 0.25s ease;
}

.confirm-price {
    color: var(--accent);
    margin: 8px 0 16px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-confirm {
    padding: 10px 28px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-confirm:hover {
    opacity: 0.85;
}

.btn-cancel {
    padding: 10px 28px;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: var(--bg-card);
}

/* Success message */
.success-msg {
    text-align: center;
    color: var(--success);
    font-weight: 600;
    padding: 16px;
    animation: fadeSlideUp 0.25s ease;
}

/* Animations */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat strong {
        font-size: 1.2rem;
    }

    .tutors-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .modal {
        padding: 24px 20px;
        max-height: 90vh;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
    }

    .modal-meta {
        justify-content: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .hero {
        padding: 120px 16px 60px;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .tutors-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 20px 16px;
        border-radius: 12px;
    }
}
