/* ========== Visual Enhancements & Mobile Optimizations ========== */

/* ========== Smooth Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* ========== Enhanced Buttons ========== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s 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.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(150, 191, 72, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.2);
}

/* ========== Enhanced Cards ========== */
.project-card,
.skill-category,
.sidebar-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.project-card::after,
.skill-category::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(150, 191, 72, 0.1), rgba(94, 142, 62, 0.1));
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.project-card:hover::after,
.skill-category:hover::after {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ========== Gradient Text Effects ========== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s infinite linear;
    background-size: 200% 100%;
}

.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 2px;
}

/* ========== Enhanced Hero Section ========== */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 150%;
    background: radial-gradient(circle, rgba(150, 191, 72, 0.1), transparent);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

.hero-stats .stat {
    transition: all 0.3s ease;
}

.hero-stats .stat:hover {
    transform: scale(1.1);
}

.hero-stats .stat-number {
    animation: pulse 2s ease-in-out infinite;
}

/* ========== Enhanced Navigation ========== */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(10, 14, 26, 0.9);
    border-bottom: 1px solid rgba(150, 191, 72, 0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

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

.nav-link:hover::after {
    width: 100%;
}

/* ========== Loading Skeleton ========== */
.skeleton {
    background: linear-gradient(90deg,
        var(--light-bg) 25%,
        var(--lighter-bg) 50%,
        var(--light-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ========== Improved Forms ========== */
input, textarea {
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(150, 191, 72, 0.2);
}

/* ========== Enhanced FAQ ========== */
.faq-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.faq-item:hover {
    border-left-color: var(--primary-color);
    background: rgba(150, 191, 72, 0.05);
}

.faq-item.active {
    background: rgba(150, 191, 72, 0.08);
    border-left-color: var(--primary-color);
}

/* ========== Mobile Optimizations ========== */

/* Tablets and below */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px 0;
    }

    h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .container {
        padding: 0 24px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
    }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }
    h4 { font-size: 1.1rem; }

    .container {
        padding: 0 20px;
    }

    /* Enhanced mobile buttons */
    .btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    .contact-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .contact-buttons .btn {
        width: 100%;
        margin: 0;
    }

    /* Better mobile cards */
    .project-card {
        margin-bottom: 24px;
    }

    .project-card:hover {
        transform: translateY(-8px);
    }

    /* Improved mobile hero */
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .hero-stats .stat {
        width: 100%;
        text-align: center;
    }

    /* Better mobile navigation */
    .nav-menu {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--darker-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.5);
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        margin: 12px 0;
    }

    /* Mobile FAQ */
    .faq-question h3 {
        font-size: 1.1rem;
    }

    .faq-answer {
        font-size: 0.95rem;
    }

    /* Mobile project grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Mobile skills */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Mobile footer */
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    :root {
        --section-padding: 50px 0;
    }

    html {
        font-size: 14px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    .container {
        padding: 0 16px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Compact mobile cards */
    .project-card img {
        height: 180px;
    }

    /* Smaller gaps */
    section {
        padding: 40px 0;
    }

    /* Compact hero */
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }
}

/* ========== RTL Enhancements ========== */
[dir="rtl"] .nav-link::after {
    right: 0;
    left: auto;
}

[dir="rtl"] .section-title::after {
    right: 0;
    left: auto;
}

[dir="rtl"] .faq-item {
    border-right: 3px solid transparent;
    border-left: none;
}

[dir="rtl"] .faq-item:hover,
[dir="rtl"] .faq-item.active {
    border-right-color: var(--primary-color);
}

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

/* ========== Dark Mode Enhancements ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
}

/* ========== Accessibility Improvements ========== */
.btn:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
