/* static/css/custom.css */

/* ------------------------- */
/* 1. ROOT & THEME VARIABLES */
/* ------------------------- */
:root {
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --accent-hover: #f97316;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --text-dark: #111827;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --accent-hover: #fb923c;
    --text-dark: #f9fafb;
    --text-light: #9ca3af;
    --bg-light: #1f2937;
    --border-color: rgba(255, 255, 255, 0.1);
}

/* ------------------------- */
/* 2. BASE & TYPOGRAPHY      */
/* ------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

[data-bs-theme="dark"] body {
    background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-dark);
}

/* ------------------------- */
/* 3. LAYOUT & NAVIGATION    */
/* ------------------------- */
.navbar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .navbar {
    background: rgba(23, 31, 42, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 800;
    color: #fff !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #fff !important;
}

#theme-switcher {
    cursor: pointer;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.main-content {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

footer {
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}
footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}
footer a:hover { text-decoration: underline; }

/* ------------------------- */
/* 4. ANIMATIONS & EFFECTS   */
/* ------------------------- */
/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}
.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float 10s infinite ease-in-out;
}
@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0; }
    50% { transform: translateY(-150px) scale(1.2); opacity: 0.7; }
    90% { opacity: 0; }
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------- */
/* 5. COMPONENTS             */
/* ------------------------- */

/* --- Glass Card --- */
.glass-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 2.5rem;
}
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
[data-bs-theme="dark"] .glass-card {
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Buttons --- */
.btn {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    color: white;
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
    color: white;
}
.btn-danger { background-color: var(--danger-color); }
.btn-danger:hover { background-color: #c82333; }

/* Social / Secondary Action Button */
.social-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.social-button:hover {
    background: rgba(255, 255, 255, 0.35);
    color: white;
}
[data-bs-theme="dark"] .social-button {
    background: rgba(75, 85, 99, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}
[data-bs-theme="dark"] .social-button:hover {
    background: rgba(75, 85, 99, 0.5);
}


/* --- Forms --- */
.card-form {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
}
.form-floating > .form-control, .form-floating > .form-select {
    background-color: #fff;
    border: 1px solid #ced4da;
}
[data-bs-theme="dark"] .form-floating > .form-control, 
[data-bs-theme="dark"] .form-floating > .form-select {
    background-color: #374151;
    border-color: #4b5563;
    color: var(--text-dark);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.25);
}
.form-floating > label {
    color: var(--text-light);
}


/* ------------------------- */
/* 6. PUBLIC PORTFOLIO PAGE  */
/* ------------------------- */

/* --- Hero Section --- */
.hero-section {
    min-height: calc(100vh - 120px); /* Adjust for nav/footer */
    display: flex;
    align-items: center;
    position: relative;
    color: white;
}
.profile-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
}
.profile-image:hover {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}
.hero-text .display-1 {
    font-weight: 800;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hero-text .lead {
    font-size: 1.5rem;
    opacity: 0.9;
}
.stat-number { font-weight: 700; font-size: 2rem; }
.stat-label { font-size: 1rem; opacity: 0.8; }
[data-bs-theme="dark"] .hero-text { color: #f0f0f0; }

/* --- Stats Section --- */
.stats-section .stat-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
}
[data-bs-theme="dark"] .stats-section .stat-label { color: #d1d5db; }


/* --- Timeline Section --- */
.timeline-section { padding: 5rem 0; }
.section-title {
    text-align: center;
    color: white;
    margin-bottom: 5rem;
}
.section-title h2 { font-size: 3rem; font-weight: 700; }
.section-title .lead { max-width: 600px; margin: 1rem auto 0; opacity: 0.9; }

.timeline-container { 
    position: relative; 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 0 15px; 
}
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
    border-radius: 2px;
}
/* MODIFIED: Increased margin-bottom for more spacing */
.timeline-item { 
    position: relative; 
    margin-bottom: 5rem; 
    /* ADDED: Ensures the item takes up space correctly */
    padding-top: 80px; /* Space for the dot + margin */
} 

.timeline-dot {
    position: absolute;
    left: 50%;
    /* MODIFIED: Set top to 0 to align with the new padding-top */
    top: 0;
    transform: translateX(-50%);
    width: 60px; height: 60px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: 4px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}
.timeline-dot.active, .timeline-dot:hover {
    transform: translateX(-50%) scale(1.15);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.6);
}
.timeline-dot[data-has-content="false"] {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}
.timeline-dot[data-has-content="false"]:hover {
    transform: translateX(-50%) scale(1);
}

/* --- NEW: Style for the wrapper --- */
.timeline-content-wrapper {
    position: relative;
    width: 100%;
}

/* --- MODIFIED: Timeline Content styles --- */
.timeline-content {
    /* REMOVED: margin-top is no longer needed here */
    width: 100%; 
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: max-height 0.7s ease, opacity 0.5s ease, padding 0.7s ease;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 2rem; 
}

[data-bs-theme="dark"] .timeline-content {
    background: rgba(55, 65, 81, 0.95);
    color: var(--text-dark);
}

.timeline-content.show {
    max-height: 1500px;
    opacity: 1;
    padding: 2rem;
}

/* REMOVED: These are no longer needed */
/* .timeline-item:nth-child(odd) .timeline-content { margin-left: 55%; } */
/* .timeline-item:nth-child(even) .timeline-content { float: left; } */


.timeline-content .accordion-button {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: var(--text-dark);
}
.timeline-content .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}
[data-bs-theme="dark"] .timeline-content .accordion-button {
    background: #374151;
}
[data-bs-theme="dark"] .timeline-content .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}
/* ------------------------- */
/* 7. DASHBOARD              */
/* ------------------------- */
.dashboard-card {
    background: var(--bg-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.07);
    height: 100%;
}
.input-group .form-control { border-right: 0; }
.input-group .btn { border-left: 0; }

/* ------------------------- */
/* 8. RESPONSIVE DESIGN      */
/* ------------------------- */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 3rem 0;
        flex-direction: column-reverse;
    }
    .profile-image { width: 180px; height: 180px; margin-bottom: 2rem; }
    .hero-text .display-1 { font-size: 3rem; }
    .hero-text .lead { font-size: 1.25rem; }
    .hero-buttons { justify-content: center; }
    
    /* MODIFIED: Adjust padding-top for smaller dots */
    .timeline-item {
        padding-top: 70px;
    }

    .timeline-dot { 
        width: 50px; 
        height: 50px; 
    }
    .timeline-content.show { 
        padding: 1.5rem; 
    }
    
    .section-title h2 { font-size: 2.2rem; }
    .glass-card { padding: 1.5rem; }
}