/* ===========================
   CV Loading - Hide content until data loads
   =========================== */
.cv-loading .hero-content,
.cv-loading .about-content,
.cv-loading .timeline,
.cv-loading .education-grid,
.cv-loading .skills-grid,
.cv-loading .profil-etendu-content,
.cv-loading .contact-content {
    opacity: 0;
    transition: opacity 0.4s ease;
}

body.cv-loaded .hero-content,
body.cv-loaded .about-content,
body.cv-loaded .timeline,
body.cv-loaded .education-grid,
body.cv-loaded .skills-grid,
body.cv-loaded .profil-etendu-content,
body.cv-loaded .contact-content {
    opacity: 1;
}

/* ===========================
   CSS Reset & Variables
   =========================== */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #2ecc71;
    --dark-bg: #1a1a2e;
    --dark-accent: #16213e;
    --light-text: #f5f5f5;
    --gray-text: #a0a0a0;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===========================
   Theme: Purple Gradient (Default)
   =========================== */
body[data-theme="purple-gradient"] {
    --primary-color: #4a90e2;
    --secondary-color: #2ecc71;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===========================
   Theme: Ocean Blue
   =========================== */
body[data-theme="ocean-blue"] {
    --primary-color: #0EA5E9;
    --secondary-color: #06B6D4;
    --accent-gradient: linear-gradient(135deg, #0EA5E9 0%, #0369A1 100%);
}

/* ===========================
   Theme: Forest Green
   =========================== */
body[data-theme="forest-green"] {
    --primary-color: #10B981;
    --secondary-color: #34D399;
    --accent-gradient: linear-gradient(135deg, #10B981 0%, #047857 100%);
}

/* ===========================
   Theme: Sunset Orange
   =========================== */
body[data-theme="sunset-orange"] {
    --primary-color: #F97316;
    --secondary-color: #FB923C;
    --accent-gradient: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--light-text);
    background: var(--dark-bg);
    overflow-x: hidden;
}

/* ===========================
   Navigation
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--light-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.9rem;
}

.language-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.language-btn .flag-icon {
    font-size: 1.2rem;
}

.language-btn .lang-text {
    font-weight: 700;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--light-text);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 3px;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6rem 2rem 4rem;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-accent) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text {
    animation: fadeInUp 1s ease-out;
}

.greeting {
    display: block;
    font-size: 1.5rem;
    color: var(--gray-text);
    margin-bottom: 0.5rem;
}

.name {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--gray-text);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--light-text);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInRight 1s ease-out;
}

.profile-photo {
    width: 350px;
    height: 350px;
    max-width: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 5px solid var(--primary-color);
    box-shadow: 0 10px 40px rgba(74, 144, 226, 0.4);
    animation: float 6s ease-in-out infinite;
    transition: var(--transition);
}

.profile-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(74, 144, 226, 0.6);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    width: 4px;
    height: 10px;
    background: var(--primary-color);
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

/* ===========================
   Sections
   =========================== */
.section {
    padding: 5rem 2rem;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* ===========================
   About Section
   =========================== */
.about-section {
    background: var(--dark-accent);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text .lead {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.about-text p {
    font-size: 1.25rem;
    color: var(--gray-text);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--dark-bg);
    border-radius: 15px;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-text);
    font-size: 1rem;
}

/* ===========================
   Experience Timeline
   =========================== */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 100px;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }

.timeline-marker {
    position: absolute;
    left: 42px;
    top: 0;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border: 4px solid var(--dark-bg);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--dark-accent);
}

.timeline-content {
    background: var(--dark-accent);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--gray-text);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--gray-text);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.achievement-list {
    list-style: none;
    padding-left: 0;
}

.achievement-list li {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-text);
    position: relative;
}

.achievement-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: 700;
}

.experience-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    transition: var(--transition);
}

.experience-toggle:hover {
    color: var(--secondary-color);
}

.toggle-icon {
    font-size: 1.5rem;
    transition: var(--transition);
    display: inline-block;
}

.experience-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(90deg);
}

.achievement-list[hidden] {
    display: none;
}

/* ===========================
   Education Section
   =========================== */
.education-section {
    background: var(--dark-accent);
}

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.education-card {
    background: var(--dark-bg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.education-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.education-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.education-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.education-card h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.education-date {
    display: block;
    color: var(--gray-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.education-card p {
    color: var(--gray-text);
    line-height: 1.6;
}

.certification-list {
    list-style: none;
    text-align: left;
}

.certification-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--dark-accent);
    border-radius: 8px;
    color: var(--gray-text);
    position: relative;
    padding-left: 2rem;
}

.certification-list li::before {
    content: '📜';
    position: absolute;
    left: 0.5rem;
}

/* ===========================
   Skills Section
   =========================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--dark-accent);
    padding: 2rem;
    border-radius: 15px;
    transition: var(--transition);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.skill-category:hover {
    box-shadow: var(--shadow-md);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-item {
    opacity: 0;
    animation: fadeInLeft 0.6s ease-out forwards;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.skill-percent {
    color: var(--primary-color);
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: var(--dark-bg);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    animation: progressBar 1.5s ease-out;
    position: relative;
    overflow: hidden;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ===========================
   Contact Section
   =========================== */
.contact-section {
    background: var(--dark-accent);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.contact-info > p {
    color: var(--gray-text);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-method {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.contact-icon {
    font-size: 2rem;
    min-width: 50px;
}

.contact-details h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.contact-details a,
.contact-details p {
    color: var(--gray-text);
    text-decoration: none;
    transition: var(--transition);
}

.contact-details a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-bg);
    border-radius: 50%;
    color: var(--light-text);
    transition: var(--transition);
}

.social-link svg {
    width: 24px;
    height: 24px;
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 0.875rem;
    border: 2px solid var(--dark-bg);
    border-radius: 8px;
    background: var(--dark-bg);
    color: var(--light-text);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(74, 144, 226, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 5px;
    color: var(--gray-text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.form-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--gray-text);
    font-style: italic;
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: var(--dark-bg);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    color: var(--gray-text);
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.9rem;
}

/* ===========================
   Back to Top Button
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
}

@keyframes progressBar {
    from {
        width: 0;
    }
}

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

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-buttons {
        justify-content: center;
    }

    .name {
        font-size: 2.5rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 60px;
    }

    .timeline-marker {
        left: 12px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(26, 26, 46, 0.98);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        display: block;
        padding: 1rem;
    }

    .language-selector {
        padding: 1rem 0;
        justify-content: center;
    }

    .language-btn {
        width: auto;
        justify-content: center;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .section-title {
        font-size: 2rem;
    }

    .hero {
        padding: 5rem 1rem 3rem;
    }

    .section {
        padding: 3rem 1rem;
    }

    .skills-grid,
    .education-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 2.5rem;
    }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===========================
   Chatbot IA
   =========================== */
.chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chat-icon {
    display: block;
}

.close-icon {
    display: none;
}

.chatbot-toggle.active .chat-icon {
    display: none;
}

.chatbot-toggle.active .close-icon {
    display: block;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 4rem);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: var(--dark-accent);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.chatbot-window.active {
    display: flex;
}

.chatbot-header {
    padding: 1.5rem;
    background: var(--accent-gradient);
    color: white;
}

.chatbot-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.chatbot-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    animation: fadeInUp 0.3s ease-out;
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 0.875rem 1.125rem;
    border-radius: 15px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.bot-message .message-content {
    background: var(--dark-bg);
    color: var(--light-text);
    border-bottom-left-radius: 5px;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 5px;
}

.chatbot-input-container {
    padding: 1rem;
    background: var(--dark-bg);
    border-top: 1px solid rgba(74, 144, 226, 0.1);
}

.api-key-setup {
    display: flex;
    gap: 0.5rem;
}

.api-key-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--dark-accent);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    color: var(--light-text);
    font-size: 0.9rem;
}

.api-key-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-save-key {
    padding: 0.75rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-save-key:hover {
    background: #3a7bc8;
}

.chatbot-input-area {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--dark-accent);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    color: var(--light-text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
}

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

.btn-send {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-send:hover:not(:disabled) {
    background: #3a7bc8;
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

.btn-reset-key {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    color: var(--gray-text);
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-reset-key:hover {
    color: var(--primary-color);
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 0.875rem 1.125rem;
    background: var(--dark-bg);
    border-radius: 15px;
    border-bottom-left-radius: 5px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gray-text);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }

    .chatbot-window {
        width: calc(100vw - 2rem);
        height: calc(100vh - 100px);
    }
}

@media (max-width: 480px) {
    .chatbot-toggle {
        width: 50px;
        height: 50px;
    }

    .chatbot-toggle svg {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   More Options Menu (Three Dots)
   ============================================ */

.more-options {
    position: relative;
}

.more-options-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.more-options-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.more-options-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.more-options-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

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

.more-options-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    border: none;
    background: white;
    color: #1a1a1a;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.2s ease;
}

.more-options-menu .menu-item:hover {
    background: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.more-options-menu .menu-item svg {
    flex-shrink: 0;
}

/* ============================================
   Loading Overlay
   ============================================ */

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content .spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-content small {
    font-size: 14px;
    opacity: 0.8;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-content::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-content::before {
    content: '✗';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-content::before {
    content: 'ℹ';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

/* ============================================
   Responsive - More Options Menu
   ============================================ */

@media (max-width: 768px) {
    .more-options-menu {
        right: -10px;
    }
}

@media (max-width: 480px) {
    .toast-notification {
        left: 10px;
        right: 10px;
        transform: translateY(-100px);
    }

    .toast-notification.show {
        transform: translateY(0);
    }
}

/* ===========================
   Extended Profile — Public Display
   =========================== */

.extended-profile-section {
    padding: 80px 0;
    background: var(--dark-accent);
}

.extended-profile-section .section-title {
    margin-bottom: 40px;
}

.pe-theme-block {
    margin-bottom: 30px;
}

.pe-theme-title {
    font-size: 20px;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

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

.pe-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background: var(--dark-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.pe-field:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pe-field-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-text);
}

.pe-field-value {
    font-size: 15px;
    color: var(--light-text);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .pe-fields {
        grid-template-columns: 1fr;
    }
}
