:root {
    /* AI & Tech Color Palette */
    --primary-color: #06b6d4; /* Electric Cyan */
    --primary-glow: rgba(6, 182, 212, 0.5);
    --secondary-color: #6366f1; /* Deep Indigo */
    --accent-color: #ec4899; /* Futuristic Pink/Violet */
    --gradient-ai: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    --footer-glow: radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.1), transparent 70%);
    --dark-bg: #030712; /* Deep Obsidian Background */
    --dark-secondary: #0f172a; /* Dark gray-blue */
    --text-main: #f8fafc;
    --text-muted: #cbd5e1; /* Reverting to a slightly softer but clear gray */
    --text-dim: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.8);
    --border-color: rgba(255, 255, 255, 0.12);
}

html, body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--dark-bg);
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    scroll-behavior: smooth;
    line-height: 1.6;
}

.text-muted {
    color: var(--text-muted) !important;
}

h1, h2, h3, h4, h5, h6, .display-3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* --- Utilities --- */
.text-muted {
    --bs-text-opacity: 1;
    color: var(--text-muted) !important;
}

.section-padding { padding: 100px 0; }
.bg-dark-secondary { background-color: var(--dark-secondary); }
.gradient-text {
    background: var(--gradient-ai);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.letter-spacing-1 { letter-spacing: 1px; }

/* --- Navbar --- */
.navbar {
    padding: 20px 0;
    transition: all 0.3s ease;
    background: transparent;
}

.navbar.scrolled {
    padding: 12px 0;
    transition: all 0.3s ease;
    background: var(--gradient-ai);
    box-shadow: 0 5px 30px rgba(6, 182, 212, 0.3);
    border-bottom: 0;
}

.navbar.scrolled .nav-link, .navbar.scrolled .navbar-brand {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.navbar.scrolled .nav-link:hover, .navbar.scrolled .nav-link.active {
    color: white !important;
}

.navbar.scrolled .nav-link::after {
    background: white;
}

.navbar-brand {
    font-size: 24px;
    letter-spacing: 2px;
    color: white !important;
}

.navbar-toggler:focus { box-shadow: none; }

.hamburger-icon {
    width: 30px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--gradient-ai);
    border-radius: 2px;
}

.hamburger-icon span:nth-child(2) {
    width: 70%;
    margin-left: auto;
}

/* --- Offcanvas Mobile Menu --- */
@media (max-width: 991px) {
    .offcanvas {
        width: 80% !important;
        max-width: 350px;
        background: rgba(3, 7, 18, 0.95) !important;
        backdrop-filter: blur(20px);
    }

    .offcanvas-header {
        padding: 30px;
    }

    .offcanvas-body {
        padding: 40px 30px;
    }

    .offcanvas .nav-link {
        font-size: 20px;
        margin-bottom: 20px;
        padding: 0 !important;
    }

    .offcanvas .btn-contact {
        margin-top: 20px;
        width: 100%;
    }
}

.nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 10px !important;
    font-size: 14px; /* Reduced for better fit */
    text-transform: capitalize;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 15px;
    width: 0;
    height: 2px;
    background: var(--gradient-ai);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: calc(100% - 30px);
}

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

.btn-primary {
    background: var(--gradient-ai);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
    color: white !important;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
    opacity: 0.9;
}

.btn-contact {
    background: var(--primary-color);
    color: #0f172a !important;
    border-radius: 30px;
    padding: 8px 25px !important;
    transition: all 0.3s ease;
}

.btn-contact:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--primary-glow);
}

/* --- Hero --- */
.hero-section {
    min-height: 100vh;
    position: relative;
    padding-top: 100px;
    z-index: 1;
    overflow: hidden;
    background: radial-gradient(circle at 20% 30%, rgba(6, 182, 212, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.1) 0%, transparent 40%);
    animation: mesh-bg 20s infinite alternate;
}

@keyframes mesh-bg {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.wheel {
    width: 3px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 2px;
    margin-top: 8px;
    animation: scroll-wheel 1.5s infinite;
}

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

.profile-image-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    padding: 10px;
    border-radius: 50%;
    background: var(--gradient-ai);
    box-shadow: 0 0 30px var(--primary-glow);
    animation: floating-ai 6s ease-in-out infinite;
}

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

.profile-img {
    border: 5px solid var(--dark-bg);
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%; /* Added for circular image */
    position: relative;
    z-index: 2;
}

.experience-badge {
    position: absolute;
    bottom: 20px;
    left: -20px;
    background: var(--primary-color);
    color: #0f172a;
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    z-index: 3;
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.4);
}

.experience-badge .number { font-size: 1.8rem; font-weight: 800; }
.experience-badge .text { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; margin-top: 5px; }

.social-sidebar {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.social-sidebar a {
    width: 45px;
    height: 45px;
    background: var(--dark-secondary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

footer {
    position: relative;
    background: var(--dark-bg);
    border-top: 1px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--primary-color), var(--accent-color), transparent) 1;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--footer-glow);
    pointer-events: none;
}

.social-sidebar a:hover {
    background: var(--primary-color);
    color: #0f172a;
    transform: translateX(-5px);
}

/* --- Skills --- */
.skill-category, .contact-card, .contact-form, .timeline-content {
    background: linear-gradient(145deg, var(--dark-secondary), rgba(30, 41, 59, 0.4));
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.skill-category {
    transition: all 0.3s ease;
    height: 100%;
}

.skill-category:hover, .contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    border-color: var(--primary-color);
}

.ai-glow-border {
    position: relative;
    border: 1px solid var(--border-color);
    background-clip: padding-box;
}

.ai-glow-border::after {
    content: '';
    position: absolute;
    top: -2px; bottom: -2px;
    left: -2px; right: -2px;
    background: var(--gradient-ai);
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-glow-border:hover::after {
    opacity: 0.3;
}

.skill-category h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
    background: linear-gradient(45deg, white, var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-category p.text-muted {
    color: #e2e8f0 !important; /* Force high contrast for descriptions */
    opacity: 0.9;
    line-height: 1.6;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
/* --- Card Shimmer --- */
.skill-category::before, .portfolio-item::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
    pointer-events: none;
}

.skill-category:hover::before, .portfolio-item:hover::before {
    left: 150%;
}

.skill-category:hover .tags li { color: white; border-color: rgba(34, 211, 238, 0.3); }

/* --- Timeline --- */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 50px auto 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}

.timeline-item:nth-child(even) { left: 50%; }
.timeline-item:nth-child(odd) { left: 0; }

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--gradient-ai);
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px var(--primary-glow);
    top: 25px;
    z-index: 10;
}

.timeline-item:nth-child(even) .timeline-dot { left: calc(50% - 8px); } /* Adjusted for even items */
.timeline-item:nth-child(odd) .timeline-dot { right: calc(50% - 8px); } /* Adjusted for odd items */


.timeline-content {
    background: var(--dark-secondary);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.timeline-content .date {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: block;
}

.timeline-content h4 { color: white; margin-bottom: 5px; }
.stat-item h3 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 5px;
    background: var(--gradient-ai);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.timeline-content h6 { color: var(--primary-color); margin-bottom: 15px; font-weight: 500; opacity: 0.9; }
.timeline-content p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0; }

/* --- Portfolio --- */
.portfolio-item {
    position: relative;
    background: var(--dark-secondary);
    border-radius: 20px;
    overflow: hidden;
    padding: 40px;
    border: 1px solid var(--border-color);
    height: 100%;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-item:hover {
    background: linear-gradient(135deg, var(--dark-secondary), rgba(99, 102, 241, 0.05));
    border-color: var(--secondary-color);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.1);
}

.portfolio-content { text-align: center; }

/* --- Contact --- */
.contact-card {
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.contact-info-box .icon-box {
    width: 50px;
    height: 50px;
    background: rgba(34, 211, 238, 0.1);
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-size: 1.2rem;
}

.contact-info-box .small.text-muted {
    color: var(--primary-color) !important;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    background: var(--dark-secondary);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-control:focus {
    background-color: var(--dark-secondary);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
    color: white;
}

/* --- Floating WhatsApp --- */
.floating-wa {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: wa-pulse 2s infinite;
}

@keyframes wa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.floating-wa:hover {
    transform: scale(1.1) rotate(10deg);
    color: white;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

@media (max-width: 768px) {
    .floating-wa {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: #0f172a;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(34, 211, 238, 0.3);
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .timeline::after { left: 40px; }
    .timeline-item { width: 100%; padding-left: 80px; padding-right: 25px; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-dot { left: 32px !important; }
    .timeline-content { text-align: left !important; }
    .nav-link { margin: 10px 0; }

    /* Ensure hamburger menu is clearly visible */
    .navbar-toggler {
        display: block !important;
        background: rgba(3, 7, 18, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 8px 12px;
        border-radius: 8px;
    }
}

@media (max-width: 767px) {
    /* Layout & Spacing Reductions */
    .section-padding { padding: 60px 0; }
    .hero-section { 
        text-align: center; 
        padding-top: 100px;
        padding-bottom: 50px;
        min-height: auto; 
    }
    
    /* Typography Scaling */
    .display-3 { font-size: 2.5rem !important; }
    h2.display-5 { font-size: 2rem !important; }
    .lead { font-size: 1.1rem; }

    /* Profile Image scaling */
    .profile-image-wrapper { 
        width: 220px; 
        height: 220px; 
        margin-bottom: 30px;
    }
    .experience-badge { 
        left: 50%; 
        transform: translateX(-50%); 
        bottom: -20px; 
        padding: 10px 20px;
    }
    .experience-badge .number { font-size: 1.4rem; }
    .experience-badge .text { font-size: 0.65rem; }

    /* Buttons Stacking & Size Reduction */
    .btn-lg {
        padding: 12px 20px !important;
        font-size: 1rem !important;
    }
    
    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 25px;
    }
    
    .hero-btns .btn {
        width: 100%;
        margin: 0 !important; /* Overrides me-3 */
        max-width: 320px;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Cards adjustments */
    .contact-card, .contact-form { padding: 30px 20px !important; }
}

/* Active Menu Underline Magic */
.navbar-nav .nav-link {
    position: relative;
    font-weight: 500;
}
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: var(--gradient-ai);
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 4px;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}
