/* Loading Animation */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.tech-loader {
    text-align: center;
    color: white;
}

.loader-text {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #fff, #6c63ff, #fff);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.binary-code {
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #6c63ff;
}

.binary-line {
    display: block;
    margin: 5px 0;
    opacity: 0;
    animation: fadeInBinary 0.5s ease forwards;
}

.binary-line:nth-child(1) { animation-delay: 0.2s; }
.binary-line:nth-child(2) { animation-delay: 0.4s; }
.binary-line:nth-child(3) { animation-delay: 0.6s; }
.binary-line:nth-child(4) { animation-delay: 0.8s; }

@keyframes fadeInBinary {
    to {
        opacity: 1;
    }
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c63ff, #4a44c9);
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.loading-percentage {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6c63ff;
    margin-top: 10px;
}

/* CSS Variables for Theme */
:root {
    --primary-color: #6c63ff;
    --secondary-color: #4a44c9;
    --text-color: #333;
    --bg-color: #fff;
    --card-bg: #f9f9f9;
    --shadow: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.dark-theme {
    --primary-color: #8a84ff;
    --secondary-color: #6c63ff;
    --text-color: #f5f5f5;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 30px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--shadow);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px var(--shadow);
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    left: 0;
    bottom: -5px;
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 20px;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary-color);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(74, 68, 201, 0.05));
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-content {
    max-width: 600px;
    flex: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-color);
    opacity: 0.8;
}

.hero-btns {
    display: flex;
    gap: 15px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-image-container {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px var(--shadow);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image-container::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background-color: var(--bg-color);
    z-index: 1;
}

.hero-image-container i {
    position: relative;
    font-size: 8rem;
    color: var(--primary-color);
    z-index: 2;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text p {
    margin-bottom: 20px;
}

.about-image {
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px var(--shadow);
}

.profile-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-placeholder i {
    font-size: 5rem;
    color: white;
}

/* Skills Section */
#skills {
    background-color: var(--card-bg);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow);
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow);
}

.skill-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.skill-card h3 {
    margin-bottom: 15px;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow);
}

.project-preview {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.project-placeholder {
    text-align: center;
    color: white;
}

.project-placeholder i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.project-placeholder p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.project-info {
    padding: 20px;
    text-align: center;
}

.project-info h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.project-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.project-link {
    font-size: 0.9rem;
    padding: 8px 15px;
}

/* Contact Section */
#contact {
    background-color: var(--card-bg);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 30px 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-link svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.social-link:hover {
    transform: translateY(-5px);
    background-color: var(--secondary-color);
}

.copyright {
    opacity: 0.7;
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Typing effect */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

/* Media Queries */
@media (max-width: 992px) {
    .hero-image-container {
        width: 300px;
        height: 300px;
    }

    .hero-image-container::before {
        width: 280px;
        height: 280px;
    }

    .hero-image-container i {
        font-size: 6rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--bg-color);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 50px;
        transition: var(--transition);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .mobile-menu {
        display: block;
    }

    .hero {
        text-align: center;
    }

    .hero .container {
        flex-direction: column;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-image {
        justify-content: center;
        margin-top: 40px;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .hero-btns {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .hero-image-container {
        width: 250px;
        height: 250px;
    }

    .hero-image-container::before {
        width: 230px;
        height: 230px;
    }

    .hero-image-container i {
        font-size: 5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .loader-text {
        font-size: 1.5rem;
    }

    .progress-bar {
        width: 250px;
    }
}