/* ========== ROOT & GLOBAL ========== */
:root {
    --primary-color: #a1a3ef;
    --secondary-color: #ec4899;
    --accent-color: #8b5cf6;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== ANIMATED BACKGROUND ========== */
.animated-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    pointer-events: none;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #ffffff;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: #6366f1;
    top: 50%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: #ec4899;
    bottom: 10%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    background: #8b5cf6;
    bottom: 20%;
    right: 15%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

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

/* ========== HERO SECTION ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    animation: fade-in-up 1s ease forwards;
    opacity: 0;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, #FFC052, #FFF67A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    background: white;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* ========== PROJECTS SECTION ========== */
.projects-section {
    min-height: 100vh;
    padding: 5rem 2rem;
    background: white;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-dark);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    margin: 1rem auto 0;
    border-radius: 2px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.project-card::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 ease;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-card h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.project-link::after {
    content: ' →';
    transition: var(--transition);
}

.project-link:hover {
    color: var(--secondary-color);
}

.project-link:hover::after {
    transform: translateX(5px);
}

.repo-link {
    font-size: 0.95rem;
}

/* ========== MODAL STYLES ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fade-in 0.3s ease;
    overflow-y: auto;
    padding: 2rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 3rem;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slide-up 0.3s ease;
    position: relative;
}

@keyframes slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.modal-icon {
    font-size: 3rem;
}

.modal-header h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin: 0;
}

.modal-body {
    line-height: 1.8;
}

.modal-body p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.screenshots-container {
    margin: 2rem 0;
}

.screenshots-container h4 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

/* ========== CAROUSEL STYLES ========== */
.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: #f5f5f5;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
}

.carousel-image.active {
    opacity: 1;
    position: relative;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--primary-color);
    width: 28px;
    border-radius: 5px;
}

.dot:hover {
    background: var(--secondary-color);
}

.screenshot {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.modal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.modal-link {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.modal-link-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.modal-link-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.modal-link-secondary {
    background: #f0f0f0;
    color: var(--primary-color);
}

.modal-link-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* ========== RESPONSIVE MODAL ========== */
@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }

    .modal-content {
        padding: 2rem 1.5rem;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-links {
        flex-direction: column;
    }

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

/* ========== CONTACT SECTION ========== */
.contact-section {
    min-height: 60vh;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    position: relative;
    z-index: 1;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-section .section-title {
    color: white;
}

.contact-section .section-title::after {
    background: linear-gradient(135deg, #ffd89b, #19547b);
}

.contact-content > p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.contact-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-link {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.contact-link:hover {
    background: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ========== FILTER TABS ========== */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2.5rem 0 3.5rem 0;
    flex-wrap: wrap;
    animation: fadeInDown 0.5s ease 0.1s both;
}

.filter-btn {
    padding: 0.85rem 2.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(139, 92, 246, 0.9);
    border-radius: 35px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:active {
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, white 0%, #f0f0f0 100%);
    color: var(--primary-color);
    border-color: white;
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.3);
    font-weight: 700;
    text-shadow: none;
}

.filter-btn.hidden-tab {
    animation: slideInRight 0.4s cubic-bezier(0.23, 1, 0.320, 1) 0.2s both;
}

@media (max-width: 768px) {
    .filter-tabs {
        gap: 0.75rem;
        margin: 2rem 0 2.5rem 0;
    }
    
    .filter-btn {
        padding: 0.75rem 1.8rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .filter-tabs {
        gap: 0.5rem;
        margin: 1.5rem 0 2rem 0;
    }
    
    .filter-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 25px;
    }
}

/* ========== FORK BADGE ========== */
.fork-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fork-icon {
    font-size: 1rem;
}

.fork-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* ========== PASSWORD MODAL ========== */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.password-modal.hidden {
    display: none;
}

.password-modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.3s ease;
}

.password-modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.password-modal-content input {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.password-modal-content input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.password-error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 1.2rem;
}

.password-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.password-buttons button {
    flex: 1;
}

.btn-gray {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
}

.btn-gray:hover {
    background: #cbd5e1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero {
        margin-top: 80px;
    }
}

@media (max-width: 480px) {
    .nav-content {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    .nav-links {
        gap: 0.5rem;
        font-size: 0.9rem;
    }
}
