/* Variables & Reset */
:root {
    --primary-color: #6366f1;
    /* Indigo */
    --primary-hover: #4f46e5;
    --bg-dark: #000;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --border-color: #334155;
    --transition: 0.3s ease;
    --transition-fast: 0.2s ease;
    --nav-height: 80px;
}

/* Light Mode Variables */
[data-theme="light"] {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #eaffee;
    --bg-card: #f4fcff;
    --text-main: #0f172a;
    --text-muted: #000000;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Disable smooth scroll on mobile to avoid conflict with browser rendering */
@media (max-width: 768px) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Base Section */
section {
    padding: 100px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.section-inner {
    width: 100%;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: clamp(2rem, 5vw, 3rem);
    text-align: center;
    position: relative;
    color: var(--text-main);
    width: 100%;
    display: block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6, var(--primary-color));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
    border-radius: 2px;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

/* Header & Navbar */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(15, 23, 42, 0.95);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Performance optimizations */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
    transform: translateZ(0);
}

@media (min-width: 769px) {
    .site-header {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

.site-header.hide {
    transform: translateY(-100%);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-img {
    max-height: 50px;
    max-width: 260px;
    object-fit: contain;
}

.logo-placeholder {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-weight: 400;
    font-size: 1rem;
    color: var(--text-muted);
}

.nav-links a i {
    margin-right: 5px;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
    border-left: 1px solid var(--border-color);
    padding-left: 2rem;
}

.social-link {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.social-link:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Mobile Menu */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    background: none;
    border: none;
    padding: 0.5rem;
}

.theme-toggle-mobile {
    display: none;
}

.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}

[data-theme="light"] .mobile-menu {
    background: rgba(248, 250, 252, 0.98);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu .nav-links {
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mobile-menu .nav-links a {
    font-size: 1.2rem;
    padding: 0.5rem 0;
    display: block;
}

.mobile-menu .social-icons {
    border-left: none;
    padding-left: 0;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Footer */
.site-footer {
    background: #020617;
    /* Slate 950 - darker than main background */
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.footer-socials a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.footer-socials a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* About Section */
.box-container {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: translateZ(0); /* Hardware acceleration */
}

@media (min-width: 769px) {
    .box-container {
        background: rgba(30, 41, 59, 0.6);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.profile-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    will-change: transform;
    backface-visibility: hidden;
}

@media (min-width: 769px) {
    .profile-circle {
        animation: float 6s ease-in-out infinite;
        box-shadow:
            0 0 20px rgba(99, 102, 241, 0.4),
            0 0 40px rgba(99, 102, 241, 0.2),
            0 8px 16px rgba(0, 0, 0, 0.3);
    }
}

.profile-circle:hover {
    animation-play-state: paused;
    transform: scale(1.08) translateY(-5px);
    box-shadow:
        0 0 30px rgba(99, 102, 241, 0.6),
        0 0 60px rgba(99, 102, 241, 0.3),
        0 12px 24px rgba(0, 0, 0, 0.4);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

.about-text-box p {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
}

/* Projects Section (Alternate Background) */
.projects-section {
    background: rgba(30, 41, 59, 0.2);
    /* Soft alternate background */
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Projects Section (Slider) */
.slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    flex-shrink: 0;
}

.slider-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slider-viewport {
    overflow-x: clip;
    overflow-y: visible;
    width: 100%;
    position: relative;
}

.slider-container {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease-in-out;
}

.project-card {
    flex: 0 0 calc(33.333% - 13.333px);
    /* 3 cards visible, with 20px gap */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .project-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .card-img {
    transform: scale(1.1);
}

.card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    font-weight: 600;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more i {
    transition: transform var(--transition);
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Mobile Slider Controls */
.mobile-slider-controls {
    display: none;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.info-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Forms */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.row-group {
    display: flex;
    gap: 1.5rem;
}

.input-half {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.2),
        0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.submit-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.mt-3 {
    margin-top: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

/* Responsive */
@media (max-width: 992px) {
    .project-card {
        flex: 0 0 calc(50% - 10px);
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: 80px 0;
    }

    .header-nav {
        display: none;
    }

    .theme-toggle-mobile {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .slider-wrapper {
        flex-direction: column;
    }

    .slider-btn.prev-btn,
    .slider-btn.next-btn {
        display: none;
    }

    .mobile-slider-controls {
        display: flex;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .project-card {
        flex: 0 0 100%;
    }

    .row-group {
        flex-direction: column;
    }

    .section-title {
        font-size: 2rem;
    }

    .box-container {
        padding: 2rem 1.5rem;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255, 255, 255, 0.05) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    flex: 0 0 calc(33.333% - 13.333px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skeleton-img {
    width: 100%;
    height: 220px;
}

.skeleton-body {
    padding: 1.5rem;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 80%;
}

@media (max-width: 992px) {
    .skeleton-card {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .skeleton-card {
        flex: 0 0 100%;
    }
}


/* Light Mode Specific Styles */
[data-theme="light"] .site-header {
    background: rgba(248, 250, 252, 0.85);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1), 0 0 20px rgba(99, 102, 241, 0.05);
}

[data-theme="light"] .box-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .projects-section {
    background: rgba(241, 245, 249, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .slider-btn {
    background: white;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .slider-btn:hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="light"] .project-card {
    background: white;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .form-control {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .site-footer {
    background: #f1f5f9;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
}

[data-theme="light"] .skeleton-card {
    background: white;
    border: 1px solid var(--border-color);
}


/* ========================================
   PHASE 1 & 2: DESIGN IMPROVEMENTS
   ======================================== */

/* Scroll Fade-In Animation Optimized */
.fade-in-element {
    opacity: 0;
    transform: translateY(15px); /* Reduced distance */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    will-change: opacity, transform;
}

.fade-in-element.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays for multiple elements */
.fade-in-element:nth-child(1) { transition-delay: 0.1s; }
.fade-in-element:nth-child(2) { transition-delay: 0.2s; }
.fade-in-element:nth-child(3) { transition-delay: 0.3s; }
.fade-in-element:nth-child(4) { transition-delay: 0.4s; }
.fade-in-element:nth-child(5) { transition-delay: 0.5s; }

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .project-card:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(99, 102, 241, 0.3);
}

.project-card:hover .card-img {
    transform: scale(1.08) rotate(1deg);
}

.project-card:hover .read-more {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Gradient Accent on Section Title - consolidated above */

/* Enhanced Shimmer for Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-card) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

[data-theme="light"] .skeleton {
    background: linear-gradient(
        90deg,
        #f1f5f9 0%,
        #e2e8f0 50%,
        #f1f5f9 100%
    );
    background-size: 200% 100%;
}

/* Button Ripple Effect */
.submit-btn {
    position: relative;
    overflow: hidden;
}

.submit-btn::after {
    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;
}

.submit-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Enhanced Form Focus States - consolidated above */

/* Smooth Section Transitions */
section {
    transition: opacity 0.3s ease;
}

/* Enhanced Social Link Hover */
.social-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    z-index: -1;
}

.social-link:hover::before {
    width: 40px;
    height: 40px;
}

.social-link:hover {
    color: var(--primary-color);
    transform: translateY(-4px) scale(1.1);
}

/* Enhanced Read More Link */
.read-more {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.read-more::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.read-more:hover::after {
    width: 100%;
}

/* Profile Photo Glow - consolidated above */

/* Slider Button Enhancement */
.slider-btn {
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-btn:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.slider-btn:active:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Theme Toggle Enhancement */
.theme-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: rotate(180deg) scale(1.1);
}

.theme-toggle:active {
    transform: rotate(180deg) scale(0.9);
}

/* Mobile Menu Slide Animation Enhancement */
.mobile-menu {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    transform: translateX(0);
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer Links Hover */
.footer-links a {
    position: relative;
    transition: all 0.3s ease;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

/* Smooth Page Load Animation */
body {
    animation: pageLoad 0.5s ease;
}

@keyframes pageLoad {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Performance Optimization: GPU Acceleration */
.project-card,
.profile-circle,
.theme-toggle,
.social-link,
.submit-btn {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* slider-btn: jangan pakai translateZ(0) agar tidak bounce */
.slider-btn {
    backface-visibility: hidden;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .profile-circle {
        animation: none;
    }
    
    .fade-in-element {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   PHASE 2: ADDITIONAL POLISH
   ======================================== */

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: bg-scroll 30s linear infinite;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

[data-theme="light"] body::before {
    background-image: radial-gradient(circle, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
}

@keyframes bg-scroll {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

/* Dynamic Color Scheme per Section */
.about-section {
    --section-accent: #6366f1;
}

.projects-section {
    --section-accent: #8b5cf6;
}

.contact-section {
    --section-accent: #06b6d4;
}

/* Apply section accent to elements */
.about-section .section-title::after {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #6366f1);
    background-size: 200% 100%;
}

.projects-section .section-title::after {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa, #8b5cf6);
    background-size: 200% 100%;
}

.contact-section .section-title::after {
    background: linear-gradient(90deg, #06b6d4, #22d3ee, #06b6d4);
    background-size: 200% 100%;
}

/* Info Icon Color per Section */
.contact-section .info-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

/* Enhanced Card Title with Subtle Gradient */
.card-title {
    background: linear-gradient(135deg, var(--text-main) 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .card-title {
    background: linear-gradient(135deg, var(--text-main) 0%, rgba(15, 23, 42, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section Divider with Glow */
.section-divider {
    height: 2px;
    margin: 4rem 0;
    background: linear-gradient(
        90deg,
        transparent,
        var(--primary-color),
        transparent
    );
    background-size: 200% 100%;
    animation: divider-glow 3s ease infinite;
    border-radius: 2px;
}

@keyframes divider-glow {
    0%, 100% { 
        background-position: 0% 50%;
        opacity: 0.3;
    }
    50% { 
        background-position: 100% 50%;
        opacity: 0.6;
    }
}

/* Enhanced Input Focus - consolidated above */

/* Animated Placeholder */
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.form-control:focus::placeholder {
    opacity: 0.3;
}

/* Enhanced Social Link with Section Color */
.footer-socials a:hover {
    color: #8b5cf6;
    transform: translateY(-3px) scale(1.15);
}

/* Smooth Page Load - consolidated above */

/* Enhanced Alert with Animation */
.alert {
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle Glow on Active Elements */
.nav-links a.active {
    color: var(--primary-color);
    position: relative;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Enhanced Skeleton with Better Animation - consolidated above */

/* Smooth Transitions for Theme Toggle */
html {
    transition: background-color 0.3s ease;
}

body {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Enhanced Box Shadow on Scroll */
.site-header {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.12);
}

/* Micro-interaction: Button Press Effect */
.submit-btn:active,
.theme-toggle:active {
    transform: scale(0.95);
}

/* Enhanced Read More with Better Animation */
.read-more {
    position: relative;
    overflow: hidden;
}

.read-more::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: left 0.3s ease;
}

.read-more:hover::before {
    left: 0;
}

/* Stagger Animation for Info List */
.info-list li {
    animation: fadeInUp 0.5s ease backwards;
}

.info-list li:nth-child(1) { animation-delay: 0.1s; }
.info-list li:nth-child(2) { animation-delay: 0.2s; }
.info-list li:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Logo Hover */
.logo-placeholder {
    transition: all 0.3s ease;
}

.logo-placeholder:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

/* Smooth Image Loading */
.card-img, .profile-circle {
    opacity: 0;
    animation: imageLoad 0.5s ease forwards;
}

@keyframes imageLoad {
    to {
        opacity: 1;
    }
}

/* Enhanced Footer with Subtle Animation */
.site-footer {
    animation: fadeIn 0.6s ease;
}

/* Disable animations on reduced motion */
@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
    
    .section-divider {
        animation: none;
    }
    
    .info-list li {
        animation: none;
    }
    
    .card-img, .profile-circle {
        animation: none;
        opacity: 1;
    }
}

/* ===========================
   Skills Section Styles
   =========================== */
.skills-section {
    padding: 80px 20px;
    background: var(--bg-dark);
}

.skills-section .box-container {
    position: relative;
}

/* skill-category-slide mengikuti lebar slider-container (fullWidth) */
#skills-slider {
    gap: 0;
}

.skill-category-slide {
    flex: 0 0 100%;
    min-width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.category-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-row:hover {
    padding-left: 10px;
    border-bottom-color: var(--primary-color);
}

.skill-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
}

.skill-info i {
    font-size: 1.5rem;
    width: 24px;
    text-align: center;
}

.skill-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-chart {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 400px;
}

.skill-track {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.skill-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .skills-section {
        padding: 60px 15px;
    }

    .skill-category-slide {
        padding: 10px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .category-label {
        font-size: 1rem;
    }

    .skill-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 0;
    }

    .skill-info {
        width: 100%;
    }

    .skill-value {
        display: none;
    }

    .skill-chart {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        flex: unset;
        overflow: hidden;
    }

    .skill-track {
        flex: 1;
        min-width: 0;
    }

    .skill-info i {
        font-size: 1.3rem;
    }

    .skill-label {
        font-size: 0.95rem;
    }
}


/* ===========================
   Testimonials Section - Auto Slide, Single Card
   =========================== */
.testimonials-section {
    padding: 80px 20px;
    background: var(--bg-dark);
}

.testimonials-track-wrapper {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    overflow-x: clip;
    overflow-y: visible;
}

.testimonials-track {
    display: flex;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.testimonial-card {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px 40px 40px;
    box-sizing: border-box;
    text-align: center;
    transition: border-color 0.3s ease;
}

.testimonial-card:hover {
    border-color: var(--primary-color);
}

.quote-icon {
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.25;
    margin-bottom: 20px;
    display: block;
}

.testimonial-content {
    margin-bottom: 24px;
}

.testimonial-content p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-main);
    font-style: italic;
    margin: 0 auto;
    max-width: 640px;
}

.testimonial-rating {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 24px;
}

.testimonial-rating i {
    color: #fbbf24;
    font-size: 1rem;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.author-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.author-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 4px;
}

.author-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Dots */
.testimonials-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.testimonials-dots .tdot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.testimonials-dots .tdot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .testimonials-section {
        padding: 60px 15px;
    }

    .testimonial-card {
        padding: 32px 24px 28px;
    }

    .testimonial-content p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .author-avatar img,
    .avatar-placeholder {
        width: 50px;
        height: 50px;
    }

    .avatar-placeholder {
        font-size: 1.2rem;
    }
}
