/* ========================================
   GLOBAL STYLES
======================================== */
html, body {
    margin: 0;
    padding: 0;
    background-color: #000;
    font-family: 'Times New Roman', Times, serif;
    padding-top: 40px;
    cursor: crosshair;
    overflow-x: hidden;
}

/* ========================================
   PAGE BACKGROUND WITH OVERLAY
======================================== */
.page-bg {
    background-image: url("/static/dotted_ripple.gif");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center 0px;
    background-color: rgba(255, 255, 255, 0.7);
    min-height: 100vh;
    height: 100%;
    width: 100vw;
    position: absolute;
    height: auto;
    top: 0;
    left: 0;
    z-index: 0;
}

/* Dark overlay on background */
.page-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1;
    pointer-events: none;
}

/* All content sits above overlay */
.page-bg > * {
    position: relative;
    z-index: 2;
}

/* ========================================
   NAVBAR
======================================== */
.navbar {
    background: transparent;
    height: 80px;
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    border-bottom: 2px solid #fff;
    backdrop-filter: blur(4px);
}

.logo img {
    height: 65px;
    width: auto;
    display: block;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
}

.nav-links li:not(:last-child) {
    border-right: 2px solid #fff;
    padding-right: 30px;
}

.nav-links li:first-child {
    border-left: 2px solid #fff;
    padding-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #aaa;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
    color: #fff;
}

.burger {
    display: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
}

/* ========================================
   HOME PAGE - INTRO SECTION
======================================== */
.intro-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
}

.intro-logo-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.intro-logo-top img {
    max-width: min(320px, 70vw);
    height: auto;
}

.intro-tagline {
    letter-spacing: 24px;
    display: block;
    margin-top: 0px;
    text-align: center;
    white-space: normal;
    word-break: break-all;
    line-height: 1;
    max-width: 95vw;
    letter-spacing: clamp(2px, 1vw, 24px);
    font-size: clamp(2.3rem, 7.5vw, 2.8rem);
}

.intro-logo-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 0;
    opacity: 0.85;
}

.intro-logo-bottom img {
    max-width: min(200px, 60vw);
    height: auto;
}

/* ========================================
   PROFILE PAGE
======================================== */
.profile-section {
    color: #fff;
    line-height: 1;
    font-size: clamp(3rem, 4rem, 3.8rem);
    white-space: normal;
    word-break: break-all;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 40px;
    padding-top: 40px;
    min-height: unset;
    height: auto;
}

.profile-section h1 {
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 45px;
}

.profile-section h2 {
    font-size: 40px;
    margin-top: 0;
    margin-bottom: 0;
}

.profile-quote {
    font-size: 20px;
    text-align: right;
}

/* ========================================
   PORTFOLIO PAGE
======================================== */
.portfolio-section {
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    align-items: center;
    box-sizing: border-box;
    padding-top: 80px;
}

.portfolio-section h1 {
    font-size: 2rem;
}

.portfolio-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0px;
}

.work-card {
    background: #151515;
    color: #fff;
    padding: 20px;
    margin-left: 40px;
    margin-top: 15px;
    border-radius: 8px;
    display: inline-block;
    width: 180px;
    height: 160px;
    vertical-align: top;
    text-align: center;
    transition: transform 0.2s;
    min-height: 50px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1c1c1c #111;
    transform-origin: center center;
    position: relative;
}

.work-card h3,
.work-card p {
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.work-card:hover {
    transform: scale(1.05);
}

.work-card .try-link {
    opacity: 0;
    transition: opacity 0.3s;
    display: inline-block;
    margin-top: 10px;
    color: #fff;
    font-weight: 600;
}

.work-card:hover .try-link {
    opacity: 1;
}

.work-card a:hover {
    color: #ccc;
}

/* ========================================
   WORK DETAIL PAGES (with io-box)
======================================== */
.work-detail-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    padding-top: 80px;  /* adjust for navbar height */
    box-sizing: border-box;
    color: #fff;
}

.works.page-bg {
    background-size: 2990px 2990px;
    background-position: center;
}

.work-detail-section h1 {
    margin-bottom: 30px;
}

.io-box {
    border: 2px solid #fff;
    border-radius: 8px;
    padding: 25px;
    background: rgba(17, 17, 17, 0.7);
    margin: 0px auto;
    width: 90%;
    box-sizing: border-box;
}

.io-box input[type="text"],
.io-box input[type="number"] {
    width: 100%;
    padding: 8px;
    margin: 5px 0 10px 0;
    border-radius: 4px;
    border: none;
    box-sizing: border-box;
    background: #222;
    color: #fff;
}

.io-box input[type="submit"] {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #fff;
    color: #000;
    cursor: pointer;
}

/* ========================================
   LINKED LIST FORM STYLES
======================================== */
.container {
    display: flex;
    gap: 10px;
    text-align: left;
}

#data-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.operation-field {
    flex-direction: column;
    display: flex;
    margin: auto;
    align-items: flex-start;
}

#index-field {
    margin-top: 10px;
    display: none;
    text-align: left;
}

#index-field.show {
    display: block;
}

.io-box select {
    width: 100%;
    padding: 8px;
    margin: 5px 0 10px 0;
    border-radius: 4px;
    border: none;
    box-sizing: border-box;
    background: #222;
    color: #fff;
}

.list-display {
    margin-top: 20px;
    color: #fff;
}

.list-display h3 {
    margin-bottom: 10px;
}

.message {
    margin-top: 15px;
    color: #ffff00;
}

.removed_message {
    margin-top: 15px;
    color: #e43109;
}

/* ========================================
   CONTACT PAGE
======================================== */
.contact-section {
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 80px; /* equal to navbar height */
    box-sizing: border-box;
    margin: 0;
    color: #fff;
}

.contact-section h1 {
    font-size: 40px;
}

.contact-section p {
    margin: 0;
    font-size: 25px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.social-links a {
    color: #fff;
    margin: 0 10px;
    transition: color 0.3s;
    margin-bottom: 5px;
}

.social-links a:hover {
    color: #ccc;
}

.social-links a i {
    font-size: 60px;
    color: #fff;
    transition: color 0.3s;
    font-size: clamp(30px, 5vw, 60px);
}

.social-links a i:hover {
    color: #ccc;
}

.social-text {
    font-size: 12px;
}

/* ========================================
   SCREEN EFFECTS
======================================== */
#zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.1);
    transition: opacity 2s, transform 3s cubic-bezier(.4, 2, .3, .9);
}

.zoom-transition {
    transform: scale(1.1);
    transition: transform 3s, filter 2s;
    filter: blur(8px);
    pointer-events: none;
}

.screen-ripple {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    animation: screen-ripple-distort 0.7s linear;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    filter: url(#wavy-ripple);
    z-index: 9999;
}

@keyframes screen-ripple-distort {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   MOBILE STYLES
======================================== */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Navbar Mobile */
    .burger {
        display: block;
    }

    .navbar {
        flex-direction: row;
        padding: 10px 40px;
        height: auto;
    }

    .logo img {
        height: 8.5vh;
        width: auto;
    }

    .nav-links {
        flex-direction: column;
        position: fixed;
        top: 69.5px;
        right: -50%;
        width: 25%;
        height: calc(100vh - 80px);
        background: rgba(0, 0, 0, 0.7);
        padding: 20px;
        text-align: center;
        transition: right 0.3s ease-in-out;
        z-index: 999;
    }

    .nav-links.show {
        right: 0;
    }

    .nav-links li {
        margin: 20px 0;
        height: auto;
    }

    .nav-links li:not(:last-child) {
        border-right: none;
        padding-right: 0;
    }

    .nav-links li:first-child {
        border-left: none;
        padding-left: 0;
    }

    .nav-links a {
        font-size: 10px;
        color: #fff;
    }

    /* Home Page Mobile */
    .intro-logo-top img {
        max-width: min(220px, 70vw);
    }

    .intro-logo-bottom img {
        max-width: min(135px, 50vw);
    }

    .intro-tagline {
        letter-spacing: 8px;
        margin-top: 0px;
        font-size: 2rem;
        padding: 0 10px;
        line-height: 1.5;
    }

    /* Profile Page Mobile */
    .profile-section {
        margin-left: 20px;
        margin-right: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 100vh;
        padding-top: 0px;
        padding-bottom: 0;
    }

    .profile-section h1 {
        line-height: 1;
        font-size: clamp(3rem, 5px, 6rem);
        text-align: left;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1;
        max-width: 100%;
        margin-top: 50px;
    }

    .profile-section h2 {
        font-size: 1.5rem;
    }

    .profile-quote {
        font-size: 1rem;
        text-align: right;
        margin-left: auto;
        margin-right: 0;
        margin-top: 45px;
        max-width: 100%;
    }

    /* Portfolio Page Mobile */
    .portfolio-section h1 {
        font-size: 2rem;
    }

    .work-card {
        width: 80%;
        max-width: 100%;
        margin: 10px auto;
        box-sizing: border-box;
    }

    /* Work Detail Pages Mobile */
    .io-box {
        width: 90%;
        max-width: 500px;
        box-sizing: border-box;
    }

    .io-box input[type="text"],
    .io-box input[type="number"] {
        word-break: break-word;
        overflow-wrap: break-word;
        width: 96%;
    }

    .operation-field {
        max-width: 90px;
    }

    .operation-field select {
        font-size: 12px;
        padding: 6px;
    }

    .list-display p {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Contact Page Mobile */
    .contact-section {
        font-size: 0.8rem;
        padding: 20px;
    }

    .contact-section h1 {
        font-size: 2.3rem;
        margin-bottom: 10px;
    }

    .contact-section p {
        font-size: 1.2rem;
        margin-bottom: 0;
    }

    .social-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    .social-links a i {
        font-size: 30px;
    }
}