:root {
    --primary: #3187FF;
    --primary-hover: #256edb;
    --bg-dark: #050506;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent-red: #ef4444;
    --grid-color: rgba(255, 255, 255, 0.03);
    /* Swatch Variables */
    --swatch-blue: #3187FF;
    --swatch-red: #ef4444;
    --swatch-orange: #dc9938;
    --swatch-orange-hover: #ff9800;
    --swatch-btn-bg: #222222;
    --swatch-btn-radius: 6px;

    /* Global Interaction Tokens */
    --btn-hover-scale: 1.05;

    /* Global Fluid Padding (Scales 160px -> 40px) */
    --fluid-padding: clamp(40px, 8vw, 160px);
}

.hidden-element {
    display: none !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Roboto Flex', sans-serif;
    min-height: 100vh;
    padding-bottom: 100px;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
}

.container {
    width: 100%;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 80px var(--fluid-padding) 20px var(--fluid-padding);
    margin-bottom: 40px;
    gap: 40px;
    flex-wrap: wrap;
}

.header-left {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.brand-logo-link {
    text-decoration: none !important;
    color: inherit !important;
    display: inline-block;
}

.brand-logo {
    font-size: 2.45rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 5px;
    color: white;
    cursor: pointer;
}

.brand-logo span {
    font-weight: 200;
    color: var(--primary);
}

.brand-subtitle {
    font-size: 1.1rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 100;
    max-width: 500px;
    letter-spacing: 0.5px;
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 500;
}

.user-welcome span {
    color: var(--primary);
    font-weight: 700;
}

.status-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.status-hint-top {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1.5px;
    font-weight: 100;
}





.real-pencil {
    height: auto;
    width: auto;
    object-fit: contain;
}

.status-hint-top strong {
    color: var(--primary);
    font-weight: 300;
    text-decoration: none;
    transition: font-weight 0.3s ease;
}

.status-hint-top a:hover strong {
    font-weight: 700;
}

.draw-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.status-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-hint-bottom {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 100;
    letter-spacing: 1px;
}

.count-active {
    color: var(--primary);
    font-weight: 700;
}

.count-separator {
    color: rgba(255, 255, 255, 0.4);
}

.count-total {
    color: rgba(255, 255, 255, 0.7);
}

.item-index {
    position: absolute;
    bottom: 7px;
    left: 7px;
    z-index: 10;
    pointer-events: none;
    color: white;
    font-weight: 100;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    background: rgba(34, 34, 34, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 0 8px;
    height: 26px;
    min-width: 26px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.skull-icon {
    width: 22.5px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skull_outline {
    width: 100%;
    height: auto;
}

/* Skull Eye Animations */
@keyframes eye-glow {

    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 2px rgba(229, 229, 49, 0.5));
    }

    50% {
        filter: brightness(1.3) drop-shadow(0 0 8px rgba(229, 229, 49, 0.8));
    }
}

.animated_eyes {
    animation: eye-glow 3s infinite ease-in-out;
}

.header-right {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 15px;
}


.auth-icon {
    width: 24px;
    height: 24px;
    filter: invert(1) brightness(1.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: block;
}

.logout-btn:hover .auth-icon,
.login-trigger-btn:hover .auth-icon {
    opacity: 0.8;
}

.progress-track {
    width: 350px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px;
    box-sizing: border-box;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    transition: width 0.3s ease;
    border-radius: 2px;
    width: var(--progress-width, 0%);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    direction: rtl;
    padding: 0 var(--fluid-padding);
}

.gallery-grid.gallery-guest {
    /* No solid background */
}

/* Upload Card (Integration) */
.insert-container {
    background: transparent;
    border: none;
    border-radius: 4px;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
}

.insert-container:hover {
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.5;
}

.insert-container input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-plus-icon {
    width: 48px;
    height: 48px;
    color: var(--swatch-blue);
    background: var(--swatch-btn-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--swatch-btn-radius);
    padding: 8px;
    transition: all 0.2s;
}

.insert-container:hover .upload-plus-icon {
    background: var(--swatch-blue);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.insert-container label {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.insert-container button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    pointer-events: none;
    /* Let parent click handle file input trigger */
}

/* Gallery Item */
.gallery-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    /* Shorter radius like the design */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    padding: 0;
    /* Remove internal padding to allow full-width headers/footers */
    direction: ltr;
    /* Restore internal Left-to-Right layout */
}

.item-header {
    padding: 10px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}


.item-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: var(--swatch-btn-bg);
    border: none;
    border-radius: var(--swatch-btn-radius);
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 10px;
    width: 40px;
    height: 40px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.btn-action.btn-active {
    background: var(--swatch-orange);
    color: black;
}

.btn-action.btn-active:hover {
    background: var(--swatch-orange-hover) !important;
    color: black !important;
}

.btn-action.btn-visibility,
.btn-action.btn-download,
.btn-action.btn-settings,
.btn-action.btn-info,
.btn-action.btn-back {
    color: var(--swatch-blue);
}

.btn-action.btn-login,
.btn-action.btn-upload {
    background: var(--swatch-blue);
    color: white;
    opacity: 1;
}

.btn-action.btn-delete {
    background: #983939;
    color: white;
    border-color: #983939;
}

.btn-action:hover {
    background: var(--swatch-blue);
    color: white;
}

.btn-action svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    transition: fill 0.2s ease;
    pointer-events: none;
}

.btn-action:hover svg {
    transform: translate(-50%, -50%) !important;
}

.btn-delete:hover {
    background: var(--swatch-red) !important;
    color: white !important;
}

.thumbnail-container {
    padding: 0;
    aspect-ratio: 1 / 1.4;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Back to cover for better thumbnail fit */
    border-radius: 4px;
    transition: transform 0.5s ease;
}


.story-indicator-link {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

.story-indicator {
    background: var(--swatch-blue);
    backdrop-filter: blur(4px);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--swatch-btn-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: background 0.2s;
    position: relative;
}

.story-indicator:hover {
    background: var(--primary-hover);
}

.story-indicator svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    fill: white;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.story-indicator:hover svg {
    transform: translate(-50%, -50%) !important;
}

/* Footer row */
.item-footer {
    padding: 10px;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.download-links {
    display: flex;
    gap: 8px;
}

.download-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 2px;
    transition: all 0.2s;
}

.download-link:hover {
    background: var(--primary);
    color: white;
}

.reorder-controls {
    display: flex;
    gap: 8px;
    /* Slightly wider gap to match the card scale visually */
    width: 100%;
}

.btn-order {
    flex: 1;
    width: auto;
}


/* Minimalist Guest View */
/* Gallery Guest Item - Transparent Track Styling */
.gallery-guest .gallery-item {
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 12px !important;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    overflow: visible !important;
    /* margin-top: 70px; */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
}

.gallery-guest .gallery-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-8px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6) !important;
}

.gallery-guest .item-header {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    position: absolute;
    top: -58px;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* .item-index now handled globally and absolutely positioned */






.gallery-guest .thumbnail-container {
    background: transparent !important;
    border: none !important;
}



/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 2px solid var(--card-border);
    border-radius: 8px;
}



/* Footer */
footer {
    padding: 60px var(--fluid-padding) 20px var(--fluid-padding);
    margin-top: 100px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 0%);
    background-position: top;
    background-size: 15px 0.3px;
    background-repeat: round no-repeat;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    align-items: start;
    padding-bottom: 60px;
}

.footer-bottom-logo {
    display: flex;
    align-items: stretch;
    gap: 15px;
}

.footer-bottom-logo .real-pencil {
    height: auto;
    width: auto;
    object-fit: contain;
}

.footer-bottom-logo h2 {
    font-size: 1.6rem;
    line-height: 1.1;
    font-weight: 200;
    text-transform: uppercase;
    color: white;
}

.footer-bottom-logo h2 a {
    color: inherit;
    text-decoration: none;
}

.footer-bottom-logo h2 span {
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--primary) !important;
    display: block;
    margin: 5px 0;
    transition: font-weight 0.3s ease;
}

.footer-bottom-logo h2 a:hover span {
    font-weight: 700;
}

.footer-nav {
    display: flex;
    justify-content: center;
}

.footer-nav-inner {
    text-align: left;
}

.footer-nav h4 {
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.footer-nav ul {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 10px;
}

.footer-nav a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-stat-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}

.footer-notif-bell {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.footer-notif-bell:hover {
    background: var(--primary-hover);
    /* Added slight brightness change for feedback */
}

.footer-notif-bell svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.footer-notif-bell:hover svg {
    transform: translate(-50%, -50%) !important;
}

.footer-page-stats {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.sub-footer {
    margin-top: 20px;
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    text-align: center;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 0%);
    background-position: top;
    background-size: 15px 0.3px;
    background-repeat: round no-repeat;
}

.social-links {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.social-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: var(--primary);
    background: transparent;
}

.social-links a svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}

.social-links a:hover svg {
    transform: translate(-50%, -50%) !important;
}

.copyright {
    line-height: 1.6;
    font-weight: 200;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.pagemaster-login-card {
    background: #000000;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 350px !important;
    padding: 20px !important;
    text-align: left !important;
}

.pagemaster-form-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.pagemaster-inputs-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.pagemaster-login-card .contact-title {
    font-size: 2.2rem;
    margin-bottom: 40px;
    letter-spacing: -1px;
    color: white !important;
}

.login-btn-row {
    display: flex;
    gap: 10px;

}

.login-btn-row button {
    flex: 1;
    margin: 0 !important;
}

.btn-cancel-glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.btn-cancel-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.modal-content h2 {
    color: var(--accent-red);
    margin-bottom: 20px;
}

.modal-content button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    margin-top: 25px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-content button:hover {
    background: var(--primary-hover);
}

.hidden {
    display: none;
}

.is-hidden .thumbnail-img,
.is-hidden .settings-thumbnail-img {
    opacity: 0.3;
    filter: grayscale(1);
    transition: all 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeIn 0.5s ease forwards;
}

/* Removal of Inline Styles - Utility Classes */
.form-logout {
    margin: 0;
}

.upload-label {
    cursor: pointer;
    width: 100%;
    display: block;
    height: 100%;
}

.upload-empty-state {
    width: 100%;
    border: none;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    height: 100%;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0 10px;
    text-transform: uppercase;
}

.footer-stat-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-notif-bell {
    background: var(--primary);
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.footer-page-stats {
    font-size: 1.5rem;
    font-weight: 500;
}

.primary-text {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
}

/* Modal helpers where inline was used */
.modal-content h2 {
    margin-bottom: 20px;
}

.modal-btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.modal-btn-group-large {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

.modal-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 4px;
    color: white;
}

.modal-download-box {
    max-width: 350px;
}

.modal-download-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.modal-download-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
}

.modal-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
}

.modal-cancel-btn-full {
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
    border: none;
    padding: 12px;
    color: white;
    border-radius: 4px;
    margin-top: 20px;
    cursor: pointer;
}

.modal-delete-btn {
    background: var(--accent-red);
}

.primary-bg {
    background: var(--primary) !important;
    color: white !important;
}

/* Disabled states for inactive UI elements */
.btn-action.disabled {
    opacity: 0.2;
    pointer-events: none;
    cursor: default;
    filter: grayscale(1);
    color: var(--text-muted) !important;
}

/* visibility icon custom display logic via classes */
.icon-visible,
.icon-hidden {
    fill: currentColor;
}

.icon-hidden {
    color: var(--accent-red);
}

.btn-visibility {
    border-radius: 4px;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gallery-item.is-hidden .btn-visibility svg {
    color: var(--swatch-red);
}

.hidden-element {
    display: none !important;
}

/* Custom Delete Warning Modal */
.modal-delete-warning {
    background-color: var(--accent-red) !important;
    color: white !important;
    text-align: center;
    border: none !important;
}

.modal-warning-icon {
    margin: 0 auto 20px;
    display: block;
}

.modal-title-white {
    color: white !important;
    font-size: 2rem;
    font-weight: 700;
}

.modal-text-white {
    color: white !important;
    opacity: 0.9;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.modal-btn-blue {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    min-width: 120px;
    transition: background 0.2s;
}

.modal-btn-blue:hover {
    background-color: var(--primary-hover);
}

.modal-title-blue {
    color: var(--primary) !important;
    margin-bottom: 20px;
}

/* Responsive Grid Adjustments */
@media (max-width: 1100px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .btn-action {
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .btn-action svg {
        width: 18px;
        height: 18px;
    }

    .item-index {
        font-size: 0.9rem;
    }

    .item-header,
    .item-footer {
        padding: 8px;
        gap: 8px;
    }

    /* Status Bar Responsive Cleanup */
    .skull-icon,
    .status-hint-bottom {
        display: none !important;
    }

    .status-main {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .progress-text {
        margin: 0 !important;
        line-height: 1;
        text-align: center;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-left,
    .status-bar,
    .header-right {
        flex: none;
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 20px 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-stat-group {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Story Presentation View --- */

.story-hero-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: block;
}

.story-content-wrapper {
    background: rgba(255, 255, 255, 0.05);
    /* Slightly darker for story images */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 20px;
    /* Tighter padding for the image card */
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.story-content-wrapper h1 {
    margin-top: 0;
    font-size: 2.8rem;
    color: white;
    margin-bottom: 30px;
    font-weight: 900;
    letter-spacing: -1px;
}

.purpose-essay-wrapper {
    margin: 0 auto !important;
    max-width: 100% !important;
    float: none !important;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 20px;
    cursor: pointer;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 12px;
    font-weight: 700;
}

.faq-item p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-item:hover h3 {
    color: var(--primary);
}

.story-body {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    font-weight: 100;
}

.story-body h2,
.story-body h3 {
    color: white;
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.story-body p {
    margin-bottom: 1.5rem;
}

/* Prevent empty Quill paragraphs from creating massive gaps */
.story-body p:empty,
.story-body p>br:only-child {
    margin: 0;
    line-height: 0;
    display: block;
    content: "";
    height: 0.5rem;
}

.story-body h2,
.story-body h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
    color: white;
}

.story-body h2:first-child,
.story-body h3:first-child {
    margin-top: 0;
}

.story-conclusion {
    margin-top: 3rem;
    font-style: italic;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
}

.highlight-prompt {
    font-style: normal;
    color: var(--primary);
}

/* Responsive adjustments for story view */
@media (max-width: 1100px) {
    .presentation-container {
        flex-direction: column;
        align-items: center;
        padding: 40px 20px;
    }

    .story-hero-section {
        position: static;
        width: 100%;
    }

    .story-content-wrapper {
        width: 100%;
        padding: 40px;
        height: auto !important;
        /* Reset height on mobile */
    }
}

/* ==========================================================================
   ADMIN STORY EDITOR
   ========================================================================== */

.body-editor {
    background-color: #f3f3f3 !important;
    background-image: none !important;
    /* Remove global grid */
    color: #333333 !important;
    padding: 0 !important;
}

.editor-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    min-height: 100vh;
}

.editor-wrapper {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#toolbar-container {
    display: flex;
    justify-content: center;
    border: none !important;
    padding: 10px 0;
    background: transparent;
}

.ql-toolbar.ql-snow {
    border: none !important;
    background: transparent !important;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.editor-card {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 60px 80px;
    min-height: 700px;
    display: flex;
    flex-direction: column;
}

.story-hint {
    color: #ccc;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
    text-align: center;
}

.editor-title-container {
    margin-bottom: 20px;
}

.editor-title-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 3rem;
    font-weight: 900;
    color: #1a1a1a;
    background: transparent;
    padding: 0;
    letter-spacing: -1.5px;
    line-height: 1.2;
}

.editor-title-input::placeholder {
    color: #e0e0e0;
}

#quill-editor {
    border: none !important;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #1a1a1a;
    height: auto;
    min-height: 500px;
}

.ql-container.ql-snow {
    border: none !important;
}

.ql-editor {
    padding: 0 !important;
}

.ql-editor blockquote {
    border-left: none !important;
    padding-left: 0 !important;
    font-style: italic;
    font-size: 1.4rem;
    color: #666;
    margin: 30px 0;
    line-height: 1.4;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    width: 100%;
}

.editor-btn {
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.1s;
}

.editor-btn:hover {
    opacity: 0.9;
}

.editor-btn:active {
    transform: scale(0.98);
}

.editor-btn-draft {
    background: #111111;
    color: #fff;
}

.editor-btn-publish {
    background: var(--swatch-blue);
    color: #fff;
}

/* --- Settings Page UI --- */
.settings-page-container {
    padding: 0 var(--fluid-padding) 60px var(--fluid-padding);
}

.editor-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

/* Maintain fixed position specifically for Story Editor */
.body-editor .editor-back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.editor-back-link:hover {
    color: white;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    align-items: flex-start;
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.settings-preview-card {
    position: sticky;
    top: 40px;
    gap: 10px;
}

.thumbnail-preview-container {
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.settings-thumbnail-img {
    width: 100%;
    height: auto;
    display: block;
}

.settings-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.meta-label {
    opacity: 0.7;
}

.meta-value {
    color: white;
    font-family: monospace;
}

.settings-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--swatch-btn-radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    font-weight: 500;
}

.settings-btn-primary {
    background: var(--primary);
    color: white;
}

.settings-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.settings-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--swatch-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.settings-btn-danger:hover {
    background: var(--swatch-red);
    color: white;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.row-group {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.settings-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    padding-bottom: 10px;
    font-weight: 700;
    display: block;
}

.input-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.settings-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: inline-block;
}

.settings-input,
.settings-textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
}

.settings-input:focus,
.settings-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.settings-textarea {
    resize: none;
    height: 100px;
}

.input-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.settings-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.character-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: monospace;
    padding-top: 2px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked+.toggle-slider:before {
    transform: translateX(22px);
    background-color: white;
}

.settings-warning-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 25px;
    line-height: 1.6;
}

.replace-container {
    display: flex;
}

.replace-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    padding: 16px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
}

.thumbnail-preview-container {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: block;
    cursor: pointer;
}

.thumbnail-preview-container.is-hidden .settings-thumbnail-img {
    filter: grayscale(1);
    opacity: 0.3;
}

.replace-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
    z-index: 2;
}

.thumbnail-preview-container:hover .replace-overlay {
    opacity: 1;
}

.replace-overlay span {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.replace-overlay .overlay-hint {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: -4px;
    text-transform: none;
    letter-spacing: 0;
}

.text-danger {
    color: var(--swatch-red) !important;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.2);
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
}

.settings-footer .settings-btn {
    width: 100%;
}

.keyword-inspiration {
    padding-bottom: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.inspiration-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.inspiration-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


.ins-tag {
    background: rgba(49, 135, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(49, 135, 255, 0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.ins-tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.visibility-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 500;
}

.settings-header-nav {
    /* Positioned within flex row */
}

.settings-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.visibility-toggle-btn .eye-icon svg {
    transition: transform 0.3s;
}

.visibility-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.visibility-toggle-btn.is-visible {
    border-color: rgba(49, 135, 255, 0.3);
    color: var(--primary);
}

.visibility-toggle-btn.is-visible .visible-icon {
    display: block;
}

.visibility-toggle-btn.is-visible .hidden-icon {
    display: none;
}

.visibility-toggle-btn.is-hidden {
    border-color: rgba(255, 68, 68, 0.3);
    color: var(--danger);
}

.visibility-toggle-btn.is-hidden .visible-icon {
    display: none;
}

.visibility-toggle-btn.is-hidden .hidden-icon {
    display: block;
}

.visibility-toggle-btn:active {
    opacity: 0.8;
}

.visibility-toggle-btn:active .visible-icon svg,
.visibility-toggle-btn:active .hidden-icon svg {
    transform: translate(-50%, -50%) !important;
}

/* Page Settings Utilities */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.visibility-toggle-btn.icon-only {
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

/* --- Contact Page --- */
.contact-page-wrapper {
    max-width: 1200px !important;
    padding: 80px !important;
}

.contact-layout-split {
    display: flex;
    gap: 80px;
    align-items: flex-start;
}

/* --- Contact Page Redesign --- */
.contact-page-outer {
    display: flex;
    justify-content: space-between;
    gap: 80px;
    padding: 100px var(--fluid-padding);
    align-items: flex-start;
    background: #000000;
}

.contact-invitation-side {
    flex: 1;
    max-width: 450px;
}

.contact-form-side {
    flex: 1.5;
    display: flex;
    justify-content: flex-end;
}

.contact-card {
    width: 100%;
    padding: 60px !important;
    margin: 0 !important;
}

.contact-header-group {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: left;
}

.contact-title {
    position: relative;
    display: block;
    width: fit-content;
}

.contact-header-icon {
    position: absolute;
    right: -20px;
    top: -12px;
    height: 24px;
    width: auto;
    color: var(--primary);
}

.contact-header-group h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: 500;
    margin: 0;
}

.contact-header-group p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    font-weight: 100;
}

.contact-secondary-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-group h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.contact-email-link {
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 300;
}

.contact-email-link:hover {
    color: var(--primary);
}

.contact-social-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-social-links a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 300;
    transition: color 0.3s;
}

.contact-social-links a:hover {
    color: var(--primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    background: #080808;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 4px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s, background 0.3s;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #000000;
}

.contact-submit-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.contact-submit-btn:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 1200px) {
    .contact-page-outer {
        flex-direction: column;
        gap: 60px;
        align-items: stretch;
    }

    .contact-invitation-side {
        max-width: 100%;
    }

    .contact-form-side {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .contact-card {
        padding: 30px !important;
    }
}

/* Force dark colors even during browser autofill */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group textarea:-webkit-autofill,
.form-group textarea:-webkit-autofill:hover,
.form-group textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: white !important;
    -webkit-box-shadow: 0 0 0px 1000px #080808 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* --- FAQ Page Styling (Unison with Contact) --- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.faq-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 1.2rem;
    color: white;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.faq-item p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    font-weight: 100;
}