:root {
    --primary-color: #4FC3F7;
    --secondary-color: #29B6F6;
    --text-dark: #FFFFFF;
    --text-light: #B0BEC5;
    --bg-light: #0F2027;
    --bg-gray: #203A43;
    --bg-darker: #2C5364;
    --border-color: #203A43;
    --shadow: 0 10px 30px rgba(79, 195, 247, 0.15);
    --shadow-hover: 0 20px 40px rgba(79, 195, 247, 0.25);
}

[data-theme="dark"] {
    --text-dark: #FFFFFF;
    --text-light: #B0BEC5;
    --bg-light: #0F2027;
    --bg-gray: #203A43;
    --bg-darker: #2C5364;
    --border-color: #203A43;
}

/* Light mode overrides */
[data-theme="light"] {
    --text-dark: #0F2027;
    --text-light: #4A5568;
    --bg-light: #F0F4F8;
    --bg-gray: #E1E8F0;
    --bg-darker: #D0DCE8;
    --border-color: #E1E8F0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ==================== TOP NAVIGATION ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    margin-right: 3rem;
}

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

.nav-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.navbar-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* ==================== TOGGLE SWITCH ==================== */
.theme-toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-checkbox {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 26px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-checkbox:checked + .toggle-label {
    background-color: var(--primary-color);
}

.toggle-switch {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: left 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-checkbox:checked + .toggle-label .toggle-switch {
    left: 27px;
}

.toggle-inner {
    position: absolute;
    top: 2px;
    left: 5px;
    font-size: 12px;
    color: white;
    pointer-events: none;
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-top: 70px;
    padding: 2rem;
}

.main-content-top {
    margin-left: 0;
}

.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hero {
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cta-button {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.6);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== ABOUT SECTION ==================== */
.about-content {
    max-width: 600px;
    text-align: center;
    margin-bottom: 3rem;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.skill-item {
    padding: 1rem;
    background-color: var(--bg-gray);
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary-color);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.skill-item:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-light);
    transform: translateY(-5px);
}

/* ==================== PROJECTS SECTION ==================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
}

.project-card {
    background-color: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    height: 350px;
}

.project-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-10px);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

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

.card-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tech-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--bg-gray);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    font-weight: 600;
}

/* Highlight Overlay */
.card-highlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.95), rgba(41, 182, 246, 0.95));
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 12px;
    z-index: 10;
}

.project-card:hover .card-highlight {
    opacity: 1;
    visibility: visible;
}

.highlight-content {
    color: white;
    text-align: center;
    animation: slideUp 0.4s ease;
}

.highlight-content h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.highlight-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
}

.highlight-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
}

/* ==================== CONTACT SECTION ==================== */
.contact-content {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.contact-content p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: inherit;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15);
}

.submit-btn {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 195, 247, 0.4);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.social-links a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-gray);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* ==================== 404 PAGE ==================== */
.not-found-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease;
}

.not-found-page.show {
    display: flex;
}

.not-found-container {
    text-align: center;
    color: white;
}

.animated-404 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 5rem;
    font-weight: bold;
    letter-spacing: 1rem;
}

.digit {
    animation: bounce 0.6s ease-in-out infinite;
}

.digit:nth-child(1) {
    animation-delay: 0s;
}

.digit:nth-child(3) {
    animation-delay: 0.2s;
}

.animated-emoji {
    font-size: 4rem;
    animation: rotate 2s linear infinite;
}

.not-found-container h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: slideDown 0.6s ease;
}

.not-found-container p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: slideUp 0.6s ease;
}

.back-home-btn {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    background-color: white;
    color: var(--primary-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease 0.2s both;
}

.back-home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-up {
    animation: fadeUp 0.8s ease forwards;
    opacity: 0;
}

.fade-up:nth-child(1) {
    animation-delay: 0.1s;
}

.fade-up:nth-child(2) {
    animation-delay: 0.2s;
}

.fade-up:nth-child(3) {
    animation-delay: 0.3s;
}

.fade-up:nth-child(4) {
    animation-delay: 0.4s;
}

.fade-up:nth-child(5) {
    animation-delay: 0.5s;
}

.fade-up:nth-child(6) {
    animation-delay: 0.6s;
}

.project-card.fade-up {
    animation-delay: calc(var(--card-index, 0) * 0.1s);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        height: 60px;
    }

    .navbar-logo {
        font-size: 1.3rem;
        margin-right: 1rem;
    }

    .nav-links {
        gap: 1rem;
        flex: none;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        color: var(--primary-color);
        background-color: var(--bg-gray);
        border-radius: 6px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        opacity: 0;
        visibility: hidden;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--bg-light);
        border-bottom: 1px solid var(--border-color);
        margin: 0;
        padding: 1rem;
        gap: 0;
        transition: all 0.3s ease;
        max-height: 0;
        overflow: hidden;
    }

    .nav-links.show {
        opacity: 1;
        visibility: visible;
        max-height: 300px;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 1rem;
        text-align: left;
        width: 100%;
        background-color: transparent;
    }

    .main-content {
        margin-top: 60px;
        padding: 1rem;
    }

    .section {
        padding: 2rem 0;
        min-height: auto;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

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

    .project-card {
        height: auto;
    }
}

@media (max-width: 480px) {
    .navbar {
        height: 50px;
        padding: 0 0.75rem;
    }

    .navbar-logo {
        font-size: 1.1rem;
        margin-right: 0.5rem;
    }

    .nav-links {
        display: none;
    }

    .nav-links.show {
        display: flex;
    }

    .toggle-label {
        width: 45px;
        height: 24px;
    }

    .toggle-switch {
        width: 18px;
        height: 18px;
    }

    .toggle-checkbox:checked + .toggle-label .toggle-switch {
        left: 23px;
    }

    .main-content {
        margin-top: 50px;
        padding: 0.5rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .animated-404 {
        gap: 1rem;
        font-size: 3rem;
    }

    .not-found-container h1 {
        font-size: 2rem;
    }

    .not-found-container p {
        font-size: 1rem;
    }

    .skills {
        grid-template-columns: repeat(2, 1fr);
    }
}
