/* Premium Interactive Features & Animations */

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1) rotate(15deg);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    font-size: 1.2rem;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.theme-toggle:hover i {
    transform: rotate(360deg);
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-color: #0a0a0f;
    --text-color: #f8fafc;
    /* Soft White */
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
}

/* Dark Theme Styles */
body.dark-theme {
    background: var(--bg-dark) !important;
    color: var(--text-main) !important;
}

body.dark-theme .navbar {
    background: rgba(10, 10, 15, 0.95) !important;
    border-bottom: 1px solid var(--border-color);
}

body.dark-theme .leadership-card,
body.dark-theme .cert-platform,
body.dark-theme .expertise-category,
body.dark-theme .pillar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.dark-theme .theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

body.dark-theme .contact-form input,
body.dark-theme .contact-form textarea,
body.dark-theme .contact-form select {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-theme .footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #1a1f3a;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0078d4, #50e6ff);
}

/* Smooth theme transition */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar,
.leadership-card,
.cert-platform,
.expertise-category,
.pillar,
.contact-form input,
.contact-form textarea,
.contact-form select,
.footer {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}


/* ===== Page Loader ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-logo {
    font-size: 4rem;
    font-weight: bold;
    color: white;
    margin-bottom: 2rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    background: var(--white);
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* ===== Scroll Progress Indicator ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 1002;
    transition: width 0.1s ease-out;
}

/* ===== Skip to Content (Accessibility) ===== */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    z-index: 1003;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== Scroll Indicator in Hero ===== */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: white;
    opacity: 1;
    transition: opacity 0.3s;
    cursor: pointer;
}

.scroll-indicator .mouse {
    width: 24px;
    height: 36px;
    border: 2px solid white;
    border-radius: 12px;
    position: relative;
}

.scroll-indicator .mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--white);
    border-radius: 2px;
    animation: scroll-down 1.5s ease-in-out infinite;
}

@keyframes scroll-down {

    0%,
    100% {
        top: 8px;
        opacity: 1;
    }

    50% {
        top: 16px;
        opacity: 0.5;
    }
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Animated Gradient Orbs ===== */
.orb-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.15), transparent);
    filter: blur(60px);
    animation: float-orb 20s ease-in-out infinite;
}

.gradient-orb:nth-child(2) {
    background: radial-gradient(circle, rgba(80, 230, 255, 0.15), transparent);
    animation-duration: 25s;
}

.gradient-orb:nth-child(3) {
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15), transparent);
    animation-duration: 30s;
}

@keyframes float-orb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(100px, -100px) scale(1.1);
    }

    50% {
        transform: translate(-50px, 100px) scale(0.9);
    }

    75% {
        transform: translate(50px, 50px) scale(1.05);
    }
}

/* ===== Floating Animation ===== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ===== Fade-in Animation ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Glassmorphism Cards ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.leadership-card,
.cert-platform,
.expertise-category {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Enhanced Button Animations ===== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.95);
}

/* ===== Hero Image Glow Effect ===== */
.profile-photo img {
    position: relative;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(0, 120, 212, 0.3),
            0 0 40px rgba(0, 120, 212, 0.2);
    }

    50% {
        box-shadow: 0 10px 40px rgba(0, 120, 212, 0.5),
            0 0 60px rgba(0, 120, 212, 0.4);
    }
}

/* ===== Staggered Card Animations ===== */
.leadership-card:nth-child(1) {
    animation-delay: 0.1s;
}

.leadership-card:nth-child(2) {
    animation-delay: 0.2s;
}

.leadership-card:nth-child(3) {
    animation-delay: 0.3s;
}

.leadership-card:nth-child(4) {
    animation-delay: 0.4s;
}

.cert-platform:nth-child(1) {
    animation-delay: 0.1s;
}

.cert-platform:nth-child(2) {
    animation-delay: 0.2s;
}

.cert-platform:nth-child(3) {
    animation-delay: 0.3s;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

/* ===== Enhanced Hamburger Animation ===== */
.hamburger {
    cursor: pointer;
    transition: all 0.3s;
}

.hamburger span {
    background: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger.active {
    transform: rotate(90deg);
}

/* ===== Parallax Hero Effect ===== */
.hero {
    position: relative;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ===== Card Hover Lift Effect ===== */
.leadership-card,
.cert-platform,
.expertise-category,
.pillar {
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.leadership-card:hover,
.cert-platform:hover,
.expertise-category:hover,
.pillar:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* ===== Credential Cards Clickable ===== */
.cert-platform {
    cursor: pointer;
    user-select: none;
}

.cert-platform:active {
    transform: scale(0.98);
}

/* ===== Enhanced Nav Link Active State ===== */
.nav-menu a {
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* ===== Expertise Tag Hover Effect ===== */
.expertise-items span {
    position: relative;
    overflow: hidden;
}

.expertise-items span::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.expertise-items span:hover::before {
    left: 100%;
}

/* ===== Achievement Number Animation ===== */
.achievement-number {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Form Focus States ===== */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* ===== Loading State for Button ===== */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== Mobile Responsive Enhancements ===== */
@media (max-width: 768px) {
    .gradient-orb {
        width: 250px;
        height: 250px;
    }

    .scroll-indicator {
        bottom: 1rem;
    }

    .page-loader .loader-logo {
        font-size: 2.5rem;
    }

    /* Fix for Badge Alignment on Mobile */
    .role-badge,
    .tech-tag,
    .hero-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        white-space: normal;
        /* Allow wrapping if needed */
        text-align: center;
    }
}

/* ===== Reduced Motion Support (Accessibility) ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .gradient-orb,
    .scroll-indicator .mouse::before,
    .profile-photo img {
        animation: none !important;
    }
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {

    .glass-card,
    .leadership-card,
    .cert-platform {
        border: 2px solid currentColor;
    }
}

/* ===== Print Styles ===== */
@media print {

    .navbar,
    .scroll-progress,
    .scroll-indicator,
    .orb-container,
    .page-loader {
        display: none !important;
    }

    body {
        background: var(--card-bg);
    }

    .hero {
        page-break-after: always;
    }
}

/* ===== HOTFIX: Force Navbar Visibility (Moved from projects.html) ===== */
.navbar {
    background: #0a0a0f !important;
    backdrop-filter: none !important;
}

.nav-brand h2 {
    color: #ffffff !important;
    opacity: 1 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.nav-menu a {
    color: #e2e8f0 !important;
}

.nav-menu a.active,
.nav-menu a:hover {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}