/* Global Styles */
:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #d4af37;
    /* Gold/Brass color */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Pretendard', sans-serif;
    --surface-color: #1a1a1a;
}

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

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    /* Reserve space for scrollbar to prevent shifts */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: margin-top 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Container Utility */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 2;
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 25px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background-color 0.4s ease, padding 0.4s ease;
}

#navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    /* Reduced Height (Middle Ground) */
    background: linear-gradient(180deg,
            #000000 0%,
            rgba(0, 0, 0, 0.8) 50%,
            rgba(0, 0, 0, 0.4) 80%,
            transparent 100%);
    z-index: -1;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Do not block clicks */
}


#navbar.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 15px 50px;
    backdrop-filter: blur(10px);
}

#navbar.scrolled::before {
    opacity: 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links li a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    position: relative;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--text-primary);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links li a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
}

.hamburger span {
    width: 30px;
    height: 2px;
    background-color: #fff;
    transition: all 0.3s ease;
}

/* Sections Common */
section {
    padding: 100px 0;
}

/* Scroll Exit Animations */
.scroll-out-fade {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.scroll-out-fade.is-exiting {
    opacity: 0 !important;
    transform: translateY(-30px) !important;
    pointer-events: none;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 60px;
    text-align: left;
    position: relative;
    /* Removed centering transforms */
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 20px 0 0;
    /* Left aligned margin */
}

/* Hero Section */
#hero {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    overflow: hidden;
}

/* Video Background */
.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    /* Default solid background as requested */
    background-color: #111;
}

#hero-video-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    /* Slightly reduced for better blend */
    transition: transform 0.3s ease;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2) 0%,
            transparent 40%,
            transparent 70%,
            var(--bg-color) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Used for click-to-edit logic */
body.edit-mode .hero-video-container {
    cursor: pointer;
    border: 2px dashed #d4af37;
}

body.edit-mode .hero-video-container:hover #hero-video-el {
    transform: scale(1.02);
    /* visual feedback */
    opacity: 0.8;
}

#video-edit-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    pointer-events: none;
    /* Let clicks pass to container logic */
    display: none;
    /* Controlled by JS */
    color: #fff;
    font-weight: bold;
    border: 1px solid #d4af37;
    z-index: 10;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    opacity: 0.7;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translate(-50%, 0);
    }

    40% {
        transform: translate(-50%, -10px);
    }

    60% {
        transform: translate(-50%, -5px);
    }
}

/* About Section */
#about {
    /* Gradient: Black -> Surface (#1a1a1a) */
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--surface-color) 100%);
}

.about-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Spread items */
    gap: 40px;
    flex-wrap: nowrap;
    /* Prevent wrapping on desktop */
}

.about-text {
    flex: 1;
    /* Take available space */
    max-width: none;
    /* Remove limit to allow flexibility */
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 2;
    text-align: right;
    /* Align Intro to Right (towards center image) */
}

.about-text strong {
    color: var(--accent-color);
    font-weight: 600;
}

.profile-container {
    /* Center item */
    flex-shrink: 0;
    /* Don't shrink image */
    margin-top: 10px;
    position: relative;
    text-align: center;
}

.profile-image {
    width: 175px;
    /* Reduced size by 30% */
    height: 175px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

/* Career Column Wrapper (Text + Details Button) */
.career-column {
    flex: 1;
    /* Take available space like about-text */
    text-align: left;
    /* Align content to left */
    display: flex;
    flex-direction: column;
    /* justify-content: center; Removed to align top or natural flow */
}

.career-text {
    /* flex: 1; Removed flex from child */
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 2;
    text-align: left;
    /* Align Career to Left (towards center image) */
}

body.edit-mode .profile-image {
    cursor: move;
    border: 2px dashed #d4af37;
    filter: grayscale(0%);
    opacity: 0.8;
    touch-action: none;
    /* Prevent scrolling while dragging */
}

body.edit-mode .profile-image:hover {
    opacity: 1;
    transform: scale(1.05);
    /* This might conflict with drag position if using transform, but we use object-position now */
}

.upload-btn-overlay {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #d4af37;
    color: #000;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.edit-btn-small {
    background: #d4af37;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.edit-btn-small:hover {
    transform: scale(1.1);
}

.profile-overlay-icon {
    position: absolute;
    bottom: 15%;
    right: 2%;
    width: 45%;
    /* Adjusted for wide logo */
    height: auto;
    background: transparent;
    pointer-events: none;
    /* Click passes through to image */
    z-index: 5;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.profile-container:hover .profile-overlay-icon {
    transform: scale(1.1);
}



.profile-container:hover .profile-overlay-icon {
    transform: scale(1.1);
}

/* Portfolio Section */
#projects {
    /* Keep surface color to match bottom of about */
    background-color: var(--surface-color);
}

/* Filter Buttons - Removed from HTML, keeping styles just in case or remove if truly unused */
/* .filter-container { ... } */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    /* Added for animation handling */
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.project-card.hidden {
    display: none;
}

.project-image {
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: #333;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease, filter 0.5s ease;
    position: relative;
    /* Ensure overlay fits perfectly inside */
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.play-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.play-btn::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #000;
    margin-left: 4px;
    /* Optical adjustment */
}

.project-card:hover .project-image {
    transform: scale(1.05);
    filter: grayscale(0%) brightness(1);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card:hover .play-btn {
    transform: scale(1);
}

.project-info {
    padding: 20px 0;
    position: relative;
    z-index: 2;
}

.project-info h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.project-info p {
    color: var(--accent-color);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Edit & Admin Controls UI */
/* Control Buttons in Edit Mode */
.control-btn-group {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Perfectly Centered */
    display: flex;
    gap: 15px;
    /* Spacing between buttons */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.control-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1);
}

.pin-btn.active {
    color: #ffd700;
    border-color: #ffd700;
}

.delete-btn {
    color: #ff4444;
    border-color: #ff4444;
}

body.edit-mode .control-btn-group {
    opacity: 1;
    pointer-events: auto;
}

/* Hide Play Button in Edit Mode to prevent confusion */
body.edit-mode .play-btn {
    opacity: 0;
    pointer-events: none;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.video-wrapper {
    width: 80%;
    max-width: 1000px;
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Contact Section */
#contact {
    /* Gradient: Surface (#1a1a1a) -> Black to match footer */
    background: linear-gradient(180deg, var(--surface-color) 0%, var(--bg-color) 100%);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.cta-btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
    margin-top: 20px;
    text-decoration: none;
}

/* Admin Controls */
#admin-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, opacity 0.2s;
}

.admin-btn:active {
    transform: scale(0.95);
}

#edit-toggle {
    background: #d4af37;
    color: #000;
}

#add-project-btn {
    background: #007bff;
}

#save-btn {
    background: #28a745;
}

#backup-btn {
    background: #6f42c1;
}

@media (max-width: 768px) {
    #admin-controls {
        bottom: 15px;
        right: 15px;
        gap: 6px;
    }

    .admin-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

.cta-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

.cta-btn.primary {
    background-color: var(--accent-color);
    color: #000;
}

.cta-btn.primary:hover {
    background-color: transparent;
    color: var(--accent-color);
}

.cta-btn.secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.cta-btn.secondary:hover {
    background-color: #6c757d;
    color: #fff;
}


/* Footer */
footer {
    background-color: #000;
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid #1a1a1a;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Edit Mode Styles */
.editable-text {
    border: 1px dashed transparent;
    transition: all 0.2s ease;
}

.editable-text.editing {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    cursor: text;
    padding: 2px 5px;
}

.editable-text.editing:focus {
    outline: none;
    background: rgba(212, 175, 55, 0.2);
}

/* Modals */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    /* Flex when active */
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.modal-content {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    border: 1px solid #333;
}

.modal-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-content {
        padding: 0 20px;
        width: 100%;
    }

    .nav-links {
        display: none;
        /* Mobile Menu Hidden by Default */
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        align-items: center;
        justify-content: center;
        gap: 30px;
        z-index: 1000;
    }

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

    .nav-links li a {
        font-size: 1.5rem;
    }

    #navbar {
        padding: 15px 20px;
    }

    .container {
        padding: 0 20px;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

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

    .about-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 30px;
    }

    .about-text {
        text-align: center;
        order: 1;
        /* Top */
    }

    .profile-container {
        margin-top: 10px;
        order: 2;
        /* Middle */
    }

    .career-column {
        text-align: left;
        order: 3;
        /* Bottom */
        width: 100%;
        /* Ensure full width for readability */
        padding: 0 20px;
        /* Add some padding */
        align-items: center;
        /* Center align items on mobile */
    }

    .career-column .details-btn-container {
        text-align: center !important;
        /* Force center button on mobile */
    }

    .profile-container {
        margin-top: 10px;
    }
}

/* Drag and Drop Styles */
.draggable-card {
    cursor: move;
}

.project-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--accent-color);
}

.project-card.drag-over {
    border: 2px solid var(--accent-color);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Career Table Styles */
.table-container {
    width: 100%;
    margin-top: 40px;
    overflow-x: auto;
    /* Horizontal scroll for mobile */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.career-table {
    width: 100%;
    border-collapse: collapse;
    /* min-width: 600px; Removed forced width to allow fit on mobile */
}

.career-table th {
    text-align: left;
    padding: 20px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--accent-color);
}

.career-table td {
    padding: 20px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    line-height: 1.6;
}

.career-table tr:last-child td {
    border-bottom: none;
}

.career-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Make Date column stand out */
.career-table td:first-child {
    color: var(--accent-color);
    font-weight: bold;
    font-family: var(--font-heading);
    text-align: center;
    /* Center date */
    white-space: nowrap;
    /* Prevent date wrapping */
}

@media (max-width: 768px) {

    .career-table th,
    .career-table td {
        padding: 15px;
        font-size: 0.85rem;
    }
}