:root {
    --nav-width: 20%;
    --transition-speed: 0.5s;
    --app-height: 100vh;
}

body[data-theme="day"] {
    --primary-color: #0077b6;
    --secondary-color: #ade8f4;
    --background-gradient: linear-gradient(135deg, #90e0ef 0%, #caf0f8 100%);
    --text-color: #03045e;
    --text-color-light: #4895ef;
    --nav-bg: rgba(255, 255, 255, 0.4);
    --element-bg: rgba(255, 255, 255, 0.7);
    --shadow-color: rgba(0, 119, 182, 0.2);
    --wave-color-1: rgba(255, 255, 255, 0.7);
    --wave-color-2: rgba(255, 255, 255, 0.5);
    --wave-color-3: rgba(255, 255, 255, 0.3);
    --wave-color-4: #fff;
    --loader-bg: #0077b6;
}

body[data-theme="sunset"] {
    --primary-color: #f77f00;
    --secondary-color: #fcbf49;
    --background-gradient: linear-gradient(135deg, #fca311 0%, #ffdd00 100%);
    --text-color: #78290f;
    --text-color-light: #d62828;
    --nav-bg: rgba(255, 255, 255, 0.3);
    --element-bg: rgba(255, 255, 255, 0.6);
    --shadow-color: rgba(247, 127, 0, 0.25);
    --wave-color-1: rgba(252, 191, 73, 0.7);
    --wave-color-2: rgba(252, 191, 73, 0.5);
    --wave-color-3: rgba(252, 191, 73, 0.3);
    --wave-color-4: #fcbf49;
    --loader-bg: #d62828;
}

body[data-theme="night"] {
    --primary-color: #8ecae6;
    --secondary-color: #219ebc;
    --background-gradient: linear-gradient(135deg, #023047 0%, #1d3557 100%);
    --text-color: #f1faee;
    --text-color-light: #a8dadc;
    --nav-bg: rgba(29, 53, 87, 0.4);
    --element-bg: rgba(29, 53, 87, 0.7);
    --shadow-color: rgba(142, 202, 230, 0.2);
    --wave-color-1: rgba(142, 202, 230, 0.7);
    --wave-color-2: rgba(142, 202, 230, 0.5);
    --wave-color-3: rgba(142, 202, 230, 0.3);
    --wave-color-4: #8ecae6;
    --loader-bg: #023047;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background var(--transition-speed) ease;
    height: 100%;
    width: 100%;
}

body.nav-collapsed #side-nav {
    margin-left: calc(-1 * var(--nav-width));
}

body.nav-collapsed #nav-toggle-btn {
    transform: rotate(180deg);
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-bg);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1), opacity 1s ease;
}

#loading-screen.loaded {
    transform: translateY(-100%);
    opacity: 0.8;
}

.loading-text {
    color: var(--wave-color-4);
    font-size: 2.5rem;
    font-weight: 600;
    opacity: 0.7;
    z-index: 2;
}

.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25%;
    overflow: hidden;
}

.waves {
    position: relative;
    width: 100%;
    height: 100%;
}

.parallax>use {
    animation: move-forever 25s cubic-bezier(.55, .5, .45, .5) infinite;
}

.parallax>use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 10s;
    fill: var(--wave-color-1);
}

.parallax>use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 13s;
    fill: var(--wave-color-2);
}

.parallax>use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 16s;
    fill: var(--wave-color-3);
}

.parallax>use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 25s;
    fill: var(--wave-color-4);
}

@keyframes move-forever {
    0% {
        transform: translate3d(-90px, 0, 0);
    }

    100% {
        transform: translate3d(85px, 0, 0);
    }
}

.container {
    display: flex;
    width: 100%;
    height: var(--app-height);
}

#side-nav {
    flex-shrink: 0;
    width: var(--nav-width);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    transition: margin-left var(--transition-speed) ease-in-out;
}

#side-nav .profile-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 20px;
    border: 4px solid var(--element-bg);
    box-shadow: 0 4px 15px var(--shadow-color);
}

#side-nav .profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#side-nav h1 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

#side-nav ul {
    list-style: none;
    width: 100%;
}

#side-nav ul li {
    margin-bottom: 15px;
}

#side-nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    padding: 10px 20px;
    display: block;
    border-radius: 20px;
    transition: all 0.3s ease;
}

#side-nav ul li a:hover,
#side-nav ul li a.active {
    background: var(--element-bg);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.theme-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 30px;
}

.theme-switcher button {
    background: transparent;
    border: 2px solid var(--text-color-light);
    color: var(--text-color-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.theme-switcher button:hover {
    opacity: 1;
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.theme-switcher button.active {
    opacity: 1;
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

#side-nav .social-links {
    margin-top: 20px;
}

#side-nav .social-links a {
    color: var(--text-color-light);
    margin: 0 10px;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

#side-nav .social-links a:hover {
    color: var(--primary-color);
}

#main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.content-section {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 60px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s, padding var(--transition-speed) ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
}

.content-section.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.nav-collapsed .content-section {
    padding-left: 14%;
    padding-right: 14%;
}

.content-section::-webkit-scrollbar {
    width: 8px;
}

.content-section::-webkit-scrollbar-track {
    background: transparent;
}

.content-section::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 20px;
    background-clip: padding-box;
    border: 2px solid transparent;
}

.content-section::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-color);
}

#home {
    padding: 0;
    justify-content: center;
}

body.nav-collapsed #home {
    padding-left: 0;
    padding-right: 0;
}

.image-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-slider .slide {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, filter 1.5s ease-in-out;
    filter: blur(0px);
}

.image-slider .slide.active {
    opacity: 1;
    z-index: 1;
}

.image-slider .slide.exiting {
    opacity: 0;
    filter: blur(10px);
}

.overlay-text {
    position: relative;
    z-index: 2;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 40px;
    border-radius: 10px;
    display: inline-block;
    margin: auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.overlay-text h2 {
    font-size: 4rem;
    margin-bottom: 10px;
}

.overlay-text p {
    font-size: 1.5rem;
}

.content-section h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 10px;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.content-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 1000px;
}

.content-section h3 {
    font-size: 1.5rem;
    color: var(--text-color-light);
    margin-top: 30px;
    margin-bottom: 10px;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.work-item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.work-item:not(.has-image) {
    background: var(--element-bg);
}

.work-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.work-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.work-item:not(.has-image) .work-item-title {
    color: var(--text-color);
}

.work-item.has-image .work-item-title {
    color: #ffffff;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.work-item.has-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.4s ease;
}

.work-item.has-image .work-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
    transition: background 0.4s ease;
}

.work-item.has-image:hover img {
    transform: scale(1.05);
}

.work-item.has-image:hover .work-item-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
}

.contact-form input,
.contact-form textarea {
    padding: 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--element-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
}

.contact-form button {
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contact-form button:hover {
    background: var(--text-color);
}

#nav-toggle-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 997;
    width: 40px;
    height: 40px;
    background: var(--element-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform var(--transition-speed) ease-in-out;
}

#nav-toggle-btn span {
    display: block;
    width: 20px;
    height: 20px;
    border-left: 3px solid var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    transform: rotate(-45deg);
}

#hamburger-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--element-bg);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--shadow-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

#hamburger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

#hamburger-btn.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

#hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}

#hamburger-btn.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 1024px) {
    :root {
        --nav-width: 25%;
    }

    body.nav-collapsed .content-section {
        padding-left: 10%;
        padding-right: 10%;
    }
}

@media (max-width: 900px) {
    body.nav-collapsed #side-nav {
        margin-left: 0;
    }

    body.nav-collapsed .content-section {
        padding-left: 30px;
        padding-right: 30px;
    }

    .container {
        flex-direction: column;
        height: auto;
        min-height: var(--app-height);
    }

    #side-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: var(--app-height);
        z-index: 998;
        transform: translateX(-100%);
        transition: transform 0.4s ease-in-out, height 0.2s ease;
    }

    #side-nav.open {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    #main-content {
        height: var(--app-height);
    }

    #hamburger-btn {
        display: flex;
    }

    #nav-toggle-btn {
        display: none;
    }

    .content-section {
        padding: 80px 30px 30px 30px;
    }

    .overlay-text h2 {
        font-size: 2.5rem;
    }

    .overlay-text p {
        font-size: 1.2rem;
    }

    .content-section h2 {
        font-size: 2.2rem;
    }
}