:root {
    --bg-color: #f0f2f5;
    --text-color: #333;
    --card-bg: rgba(255, 255, 255, 0.8);
    --primary-color: #4e54c8;
    --secondary-color: #8f94fb;
    --accent-color: #ff6b6b;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --border: 1px solid rgba(255, 255, 255, 0.18);
    --blur: blur(8px);
}

[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --card-bg: rgba(22, 33, 62, 0.8);
    --primary-color: #0f3460;
    --secondary-color: #533483;
    --accent-color: #e94560;
    --nav-bg: rgba(26, 26, 46, 0.9);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --border: 1px solid rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
}

[data-theme="light"] body {
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 95%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 95%, 1) 0, transparent 50%);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-title {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 2rem;
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: white;
    border-radius: 10px;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--nav-bg);
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
    border-bottom: var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Projects Section */
.projects-section {
    padding: 5rem 10%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.filter-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-container input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border-radius: 25px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--card-bg);
    color: var(--text-color);
    backdrop-filter: var(--blur);
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.6;
}

.categories {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: var(--blur);
    border: var(--border);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    color: var(--text-color);
}

[data-theme="dark"] .tech-tag {
    background: rgba(255, 255, 255, 0.1);
}

.btn-view {
    width: 100%;
    text-align: center;
    padding: 0.6rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-view:hover {
    background: var(--secondary-color);
}

/* About Section */
.about-section {
    padding: 5rem 10%;
    background: rgba(0, 0, 0, 0.02);
}

.about-content {
    display: flex;
    justify-content: center;
    text-align: center;
}

.about-text {
    max-width: 700px;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.skills-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skills-list span {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: 8px;
    font-weight: 500;
}

/* Contact Section */
.contact-section {
    padding: 5rem 10%;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.info-item i {
    color: var(--accent-color);
    font-size: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.8rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--nav-bg);
    backdrop-filter: var(--blur);
    border-top: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .loading-title {
        font-size: 2rem;
    }

    .loading-bar {
        width: 250px;
    }

    .navbar {
        padding: 1rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg);
        padding: 2rem;
        text-align: center;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .hero {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        height: auto;
        padding: 6rem 1rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .projects-section {
        padding: 3rem 5%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .about-section {
        padding: 3rem 5%;
    }

    .about-text p {
        font-size: 1rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-section {
        padding: 3rem 5%;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 2%;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-text p {
        font-size: 0.9rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .social-links a {
        font-size: 1.5rem;
    }
}