/* ========================================
   Modern Dark Theme Fixes & Enhancements
   ======================================== */

/* Font Family */
:root {
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

body {
    font-family: var(--font-secondary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
}

.nav-link, .btn, .footer-links {
    font-family: var(--font-secondary);
}

/* ========================================
   Mobile Responsive Fixes
   ======================================== */

@media (max-width: 768px) {
    /* Language Switcher Mobile */
    .language-switcher {
        width: 100%;
        margin: 1rem 0;
    }

    .lang-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }

    .lang-dropdown {
        position: static;
        margin-top: 0.5rem;
        width: 100%;
    }

    .lang-option {
        text-align: center;
        padding: 0.75rem;
    }

    /* Profile Image Mobile */
    .profile-image-wrapper {
        max-width: 100%;
        margin: 0 auto;
    }

    .about-image-wrapper {
        margin-bottom: 2rem;
    }

    /* Contact Section Mobile */
    .main-contact-card {
        padding: 1.5rem;
    }

    .contact-link {
        font-size: 0.9rem;
        word-break: break-word;
    }

    .contact-details {
        width: 100%;
        overflow: hidden;
    }

    .contact-details a {
        display: block;
        white-space: normal;
        word-wrap: break-word;
    }

    /* Social Icons Mobile */
    .social-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Stats Row Mobile */
    .stats-row {
        justify-content: center;
        text-align: center;
    }

    .stat-item {
        flex: 1 1 150px;
    }

    /* Hero Section Mobile */
    .hero-section {
        padding: 120px 0 50px;
    }

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

    .status-badge {
        margin: 0 auto 2rem;
    }

    .social-links {
        justify-content: center;
    }

    /* Portfolio Cards Mobile */
    .portfolio-card {
        height: 350px;
    }

    .card-back {
        padding: 1.5rem;
    }

    /* Footer Mobile */
    .footer-about {
        text-align: center;
        margin-bottom: 2rem;
    }

    .footer .social-links {
        justify-content: center;
    }

    .footer-title {
        text-align: center;
    }

    .footer-links {
        text-align: center;
    }

    .footer-contact-info {
        text-align: center;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .visual-container {
        max-width: 450px;
    }
}

/* ========================================
   Progress Bar Animation
   ======================================== */

.loading-bar {
    position: relative;
    overflow: hidden;
}

.progress-value {
    position: relative;
}

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

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

/* ========================================
   Smooth Scroll Enhancement
   ======================================== */

html {
    scroll-padding-top: 80px;
}

/* ========================================
   Accessibility Improvements
   ======================================== */

/* Focus Visible States */
*:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

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

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .navbar,
    .hero-particles,
    .scroll-to-top,
    .loading-screen {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* ========================================
   Performance Optimizations
   ======================================== */

/* GPU Acceleration for Smooth Animations */
.profile-card,
.service-card,
.portfolio-card,
.contact-card,
.nav-link,
.social-icon {
    will-change: transform;
}

/* Lazy Load Images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ========================================
   Custom Scrollbar
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 5px;
}

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

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) var(--bg-darker);
}

/* ========================================
   Loading Animation Enhancement
   ======================================== */

.loading-logo {
    animation: float-logo 3s ease-in-out infinite;
}

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

/* ========================================
   Navbar Enhancement
   ======================================== */

/* Logo Shine Effect */
.logo-wrapper {
    overflow: hidden;
    position: relative;
}

.logo-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* ========================================
   Card Hover Effects Enhancement
   ======================================== */

.service-card,
.portfolio-card,
.contact-card {
    position: relative;
    overflow: hidden;
}

.service-card::before,
.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(14, 165, 233, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.service-card:hover::before,
.contact-card:hover::before {
    left: 100%;
}

/* ========================================
   Timeline Enhancement
   ======================================== */

.timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-item.aos-animate {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Text Selection
   ======================================== */

::selection {
    background: var(--primary-blue);
    color: var(--text-white);
}

::-moz-selection {
    background: var(--primary-blue);
    color: var(--text-white);
}

/* ========================================
   Button Ripple Effect
   ======================================== */

.contact-btn,
.btn-demo,
.filter-btn {
    position: relative;
    overflow: hidden;
}

.contact-btn::after,
.btn-demo::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;
}

.contact-btn:active::after,
.btn-demo:active::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   Utility Classes
   ======================================== */

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-effect {
    box-shadow: var(--glow-blue);
}

.backdrop-blur {
    backdrop-filter: blur(20px);
}

/* ========================================
   Experience Badge Animation
   ======================================== */

.experience-badge {
    animation: badge-float 3s ease-in-out infinite;
}

@keyframes badge-float {
    0%, 100% {
        transform: rotate(-5deg) translateY(0);
    }
    50% {
        transform: rotate(-5deg) translateY(-10px);
    }
}

.experience-badge:hover {
    animation: none;
}

/* ========================================
   Portfolio Card Enhancement
   ======================================== */

.portfolio-item {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.portfolio-item.aos-animate {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   Social Icons Glow Effect
   ======================================== */

.social-icon.github:hover {
    box-shadow: 0 0 20px rgba(43, 49, 55, 0.6);
}

.social-icon.linkedin:hover {
    box-shadow: 0 0 20px rgba(0, 119, 181, 0.6);
}

.social-icon.instagram:hover {
    box-shadow: 0 0 20px rgba(228, 64, 95, 0.6);
}

.social-icon.discord:hover {
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.6);
}

/* ========================================
   Navbar Mobile Improvements
   ======================================== */

@media (max-width: 768px) {
    .navbar-actions {
        width: 100%;
        flex-direction: column;
        gap: 1rem;
    }

    .contact-btn {
        width: 100%;
        justify-content: center;
    }

    .nav-wrapper {
        width: 100%;
    }

    .navbar-nav {
        width: 100%;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   Dark Mode Image Optimization
   ======================================== */

img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ========================================
   Loading State Improvements
   ======================================== */

.loading-content {
    animation: fadeInScale 0.6s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   Footer Enhancements
   ======================================== */

.footer-links li {
    transition: all 0.3s ease;
}

.footer-links li:hover {
    transform: translateX(5px);
}

/* ========================================
   Hero Gradient Background Animation
   ======================================== */

.hero-section {
    background: radial-gradient(
        ellipse at top,
        rgba(14, 165, 233, 0.15) 0%,
        transparent 50%
    ),
    var(--gradient-dark);
}

/* ========================================
   Custom Animations
   ======================================== */

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(14, 165, 233, 0.6);
    }
}

.glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

/* ========================================
   Section Dividers
   ======================================== */

.section-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-color),
        transparent
    );
    margin: 4rem 0;
}
