:root {
    --bg-color: #f4f4f0;
    --main-black: #1a1a1a;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --accent-yellow: #ccff00; /* Cyberpunk Neon Yellow */
    --accent-purple: #bd93f9;
    --accent-blue: #8be9fd;
    --accent-red: #ff5555;
    --border-thick: 3px;
    --box-shadow-offset: 6px;
    --font-main: 'Courier New', Courier, 'Microsoft YaHei', 'PingFang SC', monospace;
    --font-display: 'Impact', 'Arial Black', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

body.dark-mode {
    --bg-color: #121212;
    --main-black: #e0e0e0; 
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --accent-yellow: #c0ca33; 
    --accent-blue: #4fc3f7;
    --accent-purple: #b39ddb;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    background-image: 
        linear-gradient(var(--main-black) 1px, transparent 1px),
        linear-gradient(90deg, var(--main-black) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    background-attachment: fixed;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 80px;
    background-color: var(--card-bg);
    border-bottom: var(--border-thick) solid var(--main-black);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}
.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 50px;
    width: auto;
    border: 2px solid var(--main-black);
    background: white;
}

.logo-text {
    font-size: 2rem;
    font-weight: 900;
    background: var(--main-black);
    color: var(--accent-yellow);
    padding: 5px 20px;
    transform: skew(-10deg);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    display: block;
    width: 30px;
    height: 4px;
    background: var(--main-black);
    transition: all 0.3s;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links li {
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.nav-links li::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--main-black);
    z-index: -1;
    transition: left 0.3s ease;
}

.nav-links li:hover::before, .nav-links li.active::before {
    left: 0;
}

.nav-links li:hover, .nav-links li.active {
    color: var(--accent-yellow);
    border: 2px solid var(--main-black);
    box-shadow: 4px 4px 0 var(--main-black);
    transform: translate(-2px, -2px);
}

/* --- Layout --- */
main {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    min-height: 80vh;
}

.page {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.active-page {
    display: block;
    opacity: 1;
    animation: slideUpFade 0.5s forwards;
}

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

.section-title {
    font-size: 3rem;
    background: var(--main-black);
    color: white;
    padding: 15px 30px;
    margin-bottom: 50px;
    display: inline-block;
    box-shadow: 10px 10px 0 var(--accent-yellow);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    top: -10px; left: -10px;
    width: 100%; height: 100%;
    border: 2px solid var(--main-black);
    z-index: -1;
}

/* --- Components --- */
.brutal-btn {
    border: 3px solid var(--main-black);
    background: var(--card-bg);
    color: var(--text-color);
    padding: 15px 40px;
    font-weight: 900;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--box-shadow-offset) var(--box-shadow-offset) 0 var(--main-black);
    text-transform: uppercase;
    transition: all 0.1s;
    position: relative;
    font-family: var(--font-display);
    letter-spacing: 1px;
}

.brutal-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: calc(var(--box-shadow-offset) + 2px) calc(var(--box-shadow-offset) + 2px) 0 var(--main-black);
    background-color: var(--accent-yellow);
    color: #1a1a1a; /* Always black text on yellow */
}

.brutal-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--main-black);
}

.brutal-btn.full { width: 100%; background: var(--main-black); color: var(--bg-color); border-color: var(--bg-color); box-shadow: 6px 6px 0 var(--accent-red); }
.brutal-btn.full:hover { background: var(--card-bg); color: var(--text-color); border-color: var(--main-black); }

.brutal-btn.sm {
    padding: 8px 20px;
    font-size: 0.9rem;
    box-shadow: 3px 3px 0 var(--main-black);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    border: 4px solid var(--main-black);
    padding: 80px 40px;
    background: var(--accent-yellow);
    box-shadow: 20px 20px 0 var(--main-black);
    position: relative;
    overflow: hidden;
}

.hero h1 { font-size: 5rem; margin-bottom: 10px; text-shadow: 4px 4px 0 white; }
.hero h2 { font-size: 1.5rem; background: var(--card-bg); color: var(--text-color); display: inline-block; padding: 5px 15px; border: 2px solid var(--main-black); transform: rotate(-2deg); margin-bottom: 40px;}

.hero-img-container {
    background: var(--card-bg);
    border: 4px solid var(--main-black);
    padding: 15px;
    margin: 40px auto;
    max-width: 900px;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.hero-img-container:hover { transform: scale(1.01); }

#hero_main_img {
    width: 100%;
    display: block;
    border: 2px solid var(--main-black);
    min-height: 300px;
    background: #eee;
    object-fit: cover;
}

/* --- Tables --- */
.table-container { overflow-x: auto; border: 3px solid var(--main-black); box-shadow: 8px 8px 0 var(--main-black); }
.brutal-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    color: var(--text-color);
    min-width: 800px;
}
.brutal-table th, .brutal-table td {
    border: 1px solid var(--main-black);
    padding: 15px;
    text-align: left;
}
.brutal-table th {
    background: var(--accent-blue);
    color: #1a1a1a; /* Header always readable */
    font-family: var(--font-display);
    font-size: 1.2rem;
    border-bottom: 3px solid var(--main-black);
}
.brutal-table tr:hover { background-color: rgba(0,0,0,0.05); }
body.dark-mode .brutal-table tr:hover { background-color: rgba(255,255,255,0.1); }

/* --- Gallery Masonry --- */
.gallery-masonry {
    column-count: 3;
    column-gap: 25px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 25px;
    background: var(--card-bg);
    border: 3px solid var(--main-black);
    padding: 12px;
    box-shadow: 8px 8px 0 var(--main-black);
    position: relative;
    transition: all 0.3s;
}

.gallery-item:hover {
    transform: translate(-5px, -5px);
    box-shadow: 13px 13px 0 var(--accent-purple);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    display: block;
    border: 2px solid var(--main-black);
    cursor: zoom-in;
    filter: grayscale(20%);
    transition: filter 0.3s;
}
.gallery-item:hover img { filter: grayscale(0%); }

/* --- Forms & Inputs --- */
input, select, textarea {
    width: 100%;
    padding: 15px;
    border: 3px solid var(--main-black);
    margin-bottom: 20px;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    box-shadow: 4px 4px 0 #ccc;
    transition: box-shadow 0.2s;
}
body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
    background: #2c2c2c;
    border-color: #555;
    color: #fff;
    box-shadow: 4px 4px 0 #444;
}
input:focus, select:focus, textarea:focus {
    box-shadow: 4px 4px 0 var(--accent-yellow);
    background: var(--card-bg); 
}
body.dark-mode input:focus, body.dark-mode select:focus, body.dark-mode textarea:focus {
    background: #333;
    border-color: var(--accent-yellow);
    box-shadow: 4px 4px 0 var(--accent-yellow);
}

/* --- Login & Admin --- */
.login-container {
    max-width: 450px;
    margin: 0 auto;
    background: var(--card-bg);
    border: var(--border-thick) solid var(--main-black);
    box-shadow: 15px 15px 0 var(--accent-red);
}
.tabs { display: flex; border-bottom: var(--border-thick) solid var(--main-black); }
.tab-btn {
    flex: 1; padding: 20px;
    border: none; border-right: var(--border-thick) solid var(--main-black);
    background: #f0f0f0; cursor: pointer;
    color: #1a1a1a; /* Buttons stay light usually unless active */
    font-weight: 900; font-family: var(--font-display); font-size: 1.2rem;
    transition: background 0.2s;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active { background: var(--accent-yellow); }

.admin-section {
    border: 3px solid var(--main-black);
    padding: 30px;
    margin-top: 40px;
    background: var(--card-bg);
    box-shadow: 8px 8px 0 #999;
}
.schedule-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.time-selector-group select {
    text-align: center;
    padding: 10px;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 80px;
    padding: 40px;
    border-top: 4px solid var(--main-black);
    background: var(--accent-yellow);
    font-weight: bold;
}

/* --- Utilities --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 0, 0.2); /* Yellow tint */
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--card-bg);
    color: var(--text-color);
    border: 5px solid var(--main-black);
    padding: 30px;
    width: 90%; max-width: 800px;
    box-shadow: 20px 20px 0 var(--main-black);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.crop-modal-content {
    /* Specific fix for crop modal */
    overflow: hidden; /* Container shouldn't scroll, internal crop container might */
}
.crop-container {
    height: 500px; /* Fixed height for cropper */
    background: #333;
    margin: 20px 0;
    overflow: hidden;
}
.modal-actions {
    margin-top: auto; /* Push to bottom if flex */
    background: var(--card-bg);
    padding-top: 10px;
    z-index: 10;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}
.lightbox-overlay img {
    max-width: 95%;
    max-height: 95%;
    border: 5px solid white;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    /* Improve text size ratio */
    html { font-size: 14px; }

    .navbar {
        flex-direction: row; /* Keep logo and burger in a row */
        height: 60px; /* Smaller navbar on mobile */
        padding: 0 15px;
        justify-content: space-between;
    }
    
    .logo-text { font-size: 1.5rem; }
    .logo-img { height: 40px; }

    .hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 60px; /* Adjusted for smaller navbar */
        right: -100%; 
        width: 100%;
        height: calc(100vh - 60px);
        background: var(--card-bg);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 20px;
        gap: 20px;
        text-align: center;
        transition: right 0.4s ease-in-out;
        border-left: 3px solid var(--main-black);
        z-index: 999;
        overflow-y: auto; /* Allow scrolling if menu is long */
    }
    
    .nav-links.nav-active { right: 0; }
    .nav-links li { width: 80%; animation: navLinkFade 0.5s ease forwards 0.2s; }
    
    @keyframes navLinkFade {
        from { opacity: 0; transform: translateX(50px); }
        to { opacity: 1; transform: translateX(0); }
    }
    
    /* Hero adjustments */
    .hero { padding: 30px 15px; border-width: 3px; box-shadow: 10px 10px 0 var(--main-black); }
    .hero h1 { font-size: 2.5rem; }
    
    /* Ensure images don't overflow */
    img { max-width: 100%; height: auto; }
    
    .gallery-masonry { column-count: 1; }
    
    .schedule-form-grid { grid-template-columns: 1fr; }
    
    .section-title { font-size: 1.8rem; width: 100%; text-align: center; margin-bottom: 30px; padding: 10px; }
    
    /* Better padding for main */
    main { padding: 0 10px; margin: 30px auto; }

    /* Tables horizontal scroll hint */
    .table-container { position: relative; }
    .table-container::after {
        content: '← SCROLL →';
        display: block; text-align: center; font-size: 0.8rem; color: #666; padding: 5px;
    }
}
/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    background: var(--main-black);
    border: 3px solid var(--main-black);
}

.calendar-day {
    background: var(--card-bg);
    color: var(--text-color);
    min-height: 120px;
    padding: 10px;
    position: relative;
    transition: background 0.2s;
}

.calendar-day:hover {
    background: rgba(0,0,0,0.05);
}
body.dark-mode .calendar-day:hover { background: rgba(255,255,255,0.1); }

.calendar-day.empty {
    background: #ccc;
}
body.dark-mode .calendar-day.empty { background: #333; }

.day-number {
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    top: 5px; right: 10px;
    color: #999;
}

.schedule-item {
    font-size: 0.8rem;
    color: #1a1a1a;
    border: 1px solid var(--main-black);
    padding: 2px 4px;
    margin-top: 2px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schedule-item:hover {
    transform: scale(1.05);
    z-index: 10;
    position: relative;
}

/* Studio Colors */
.studio-wuying { background: var(--accent-yellow); }
.studio-shengdan { background: #00FFFF; }
.studio-saibo { background: var(--accent-purple); }

/* View toggles */
.view-pc { display: block; white-space: nowrap; font-size: 12px; }
.view-mobile { display: none; }

/* Staff (Photographer & MUA) Profile */
.staff-card {
    min-width: 150px;
    border: 3px solid var(--main-black);
    background: var(--card-bg);
    padding: 15px;
    box-shadow: 6px 6px 0 var(--main-black);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.staff-card:hover {
    transform: scale(1.05);
    box-shadow: 8px 8px 0 var(--accent-blue);
}
.staff-avatar {
    width: 80px; height: 80px;
    background: #ccc;
    border-radius: 50%;
    border: 2px solid var(--main-black);
    margin-bottom: 10px;
    object-fit: cover;
}

/* Responsive Calendar */
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
        display: block; 
    }
    .calendar-day {
        min-height: auto;
        margin-bottom: 5px; /* Compact spacing */
        border: 2px solid var(--main-black);
        padding: 5px;
    }
    .calendar-day.empty { display: none; }
    .day-number { 
        position: static; 
        margin-bottom: 2px; 
        color: black; 
        font-size: 1rem;
        background: #eee;
        padding: 2px 5px;
        display: inline-block;
    }

    /* Mobile Schedule Item Layout */
    .schedule-item {
        margin-top: 5px;
        padding: 10px;
    }
    .view-pc { display: none; }
    .view-mobile { 
        display: flex; 
        justify-content: space-between;
        align-items: center;
    }
    .mobile-time {
        font-size: 1.1rem;
        font-weight: bold;
        font-family: var(--font-display);
        flex-shrink: 0;
        margin-right: 10px;
    }
    .mobile-info {
        font-size: 0.9rem;
        text-align: right;
    }
}
/* Chat Interface */
.chat-container {
    background: var(--card-bg);
    border: 3px solid var(--main-black);
    padding: 20px;
    height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border: 2px solid var(--main-black);
    position: relative;
    word-wrap: break-word;
}

.chat-bubble .user {
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    opacity: 0.8;
}

.chat-bubble.me {
    align-self: flex-end;
    background: var(--accent-yellow);
    color: #1a1a1a; /* Me always black on yellow */
    border-radius: 15px 15px 0 15px;
    box-shadow: -4px 4px 0 rgba(0,0,0,0.1);
}

.chat-bubble.other {
    align-self: flex-start;
    background: white;
    color: #1a1a1a;
    border-radius: 15px 15px 15px 0;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}
body.dark-mode .chat-bubble.other {
    background: #333;
    color: #f0f0f0;
    border-color: #666;
}

.chat-bubble .time {
    font-size: 0.7rem;
    margin-top: 5px;
    text-align: right;
    opacity: 0.6;
    display: block;
}
