/* ============================================================
   DOBBLE GENERATOR — PREMIUM MINIMALIST DESIGN SYSTEM
   Accent: Sage Green  |  Font: Outfit  |  Default: Light Mode
   ============================================================ */

/* --- 0. DESIGN TOKENS --- */
:root {
    /* Layout */
    --sidebar-width: 300px;
    --right-sidebar-width: 250px;

    /* Colors — Light Mode (Default) */
    --bg-primary: #FAFAF8;
    --bg-secondary: #F2F1EE;
    --bg-surface: rgba(255, 255, 255, 0.82);
    --bg-surface-hover: rgba(0, 0, 0, 0.035);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-interactive: rgba(0, 0, 0, 0.12);
    --text-primary: #1A1A1A;
    --text-secondary: rgba(26, 26, 26, 0.55);
    --text-tertiary: rgba(26, 26, 26, 0.35);
    --accent: #6B8F71;
    --accent-hover: #5A7D60;
    --accent-subtle: rgba(107, 143, 113, 0.10);
    --accent-glow: rgba(107, 143, 113, 0.18);
    --success: #4A9B56;
    --success-subtle: rgba(74, 155, 86, 0.10);
    --warning: #C89B2E;
    --warning-subtle: rgba(200, 155, 46, 0.10);
    --error: #C0564E;
    --error-subtle: rgba(192, 86, 78, 0.10);
    --card-bg: #FFFFFF;
    --card-border: rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 32px rgba(107, 143, 113, 0.13);
}

body.dark-mode {
    --bg-primary: #0A0A0F;
    --bg-secondary: #12121A;
    --bg-surface: rgba(255, 255, 255, 0.04);
    --bg-surface-hover: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-interactive: rgba(255, 255, 255, 0.12);
    --text-primary: #F0EDE8;
    --text-secondary: rgba(240, 237, 232, 0.55);
    --text-tertiary: rgba(240, 237, 232, 0.35);
    --accent: #8BAF91;
    --accent-hover: #9DC0A3;
    --accent-subtle: rgba(139, 175, 145, 0.12);
    --accent-glow: rgba(139, 175, 145, 0.22);
    --success: #6EBF7B;
    --success-subtle: rgba(110, 191, 123, 0.12);
    --warning: #E8B84A;
    --warning-subtle: rgba(232, 184, 74, 0.12);
    --error: #D4726A;
    --error-subtle: rgba(212, 114, 106, 0.12);
    --card-bg: #1A1A24;
    --card-border: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 32px rgba(139, 175, 145, 0.14);
}

/* --- 1. RESET & BASE --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    width: 100%;
    display: flex;
    transition: background-color 0.4s ease, color 0.4s ease;
    line-height: 1.5;
}

/* --- 2. LAYOUT --- */
.container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* --- 3. SIDEBAR (Glassmorphism) --- */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--bg-surface);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-right: 1px solid var(--border-subtle);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    z-index: 10;
    transition: background 0.4s ease;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-interactive);
    border-radius: 2px;
}

/* --- 3.1 Sidebar Header --- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
}

.logo-accent {
    font-weight: 300;
    color: var(--accent);
}

/* --- 3.1.1 Language Switcher --- */
.lang-switcher-container {
    display: flex;
    align-items: center;
}

.lang-switcher-btn {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lang-switcher-btn:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

#currentLangDisplay {
    margin-left: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
}

/* Language Modal Grid */
.lang-modal-content {
    max-width: 600px;
    width: 90%;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 16px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 4px;
}

.lang-grid::-webkit-scrollbar {
    width: 4px;
}

.lang-grid::-webkit-scrollbar-track {
    background: transparent;
}

.lang-grid::-webkit-scrollbar-thumb {
    background: var(--border-interactive);
    border-radius: 2px;
}

.lang-modal-btn {
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.lang-modal-btn:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

.lang-modal-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 1px 4px var(--accent-glow);
}

/* --- 3.2 Theme Toggle --- */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.theme-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:active .theme-icon {
    transform: rotate(25deg);
}

/* --- 3.3 Section Labels --- */
.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-top: 16px;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

/* --- 3.4 Control Groups --- */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label:not(.upload-zone) {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* --- 3.5 Upload Zone --- */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px dashed var(--border-interactive);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease;
    text-align: center;
    font-weight: 400;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-subtle);
    border-style: solid;
}

.upload-icon {
    color: var(--text-tertiary);
    transition: color 0.25s ease, transform 0.25s ease;
}

.upload-zone:hover .upload-icon {
    color: var(--accent);
    transform: translateY(-2px);
}

.upload-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.upload-hint {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    line-height: 1.3;
    font-style: normal;
    margin: 0;
}

/* --- 3.6 Status Badge --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 100px;
    background: var(--error-subtle);
    color: var(--error);
    transition: background 0.3s ease, color 0.3s ease;
    align-self: flex-start;
}

.status-badge.success {
    background: var(--success-subtle);
    color: var(--success);
    animation: badgePulse 0.5s ease;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* --- 3.7 Select / Dropdown --- */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-interactive);
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

/* --- 3.8 Range Slider --- */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border-interactive);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 8px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 4px var(--accent-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px var(--accent-subtle);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 4px var(--accent-subtle);
    transition: transform 0.2s ease;
}

input[type="range"]::-moz-range-track {
    height: 4px;
    background: var(--border-interactive);
    border-radius: 2px;
}

/* --- 3.9 Buttons --- */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-interactive);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover {
    background: transparent;
    border-color: var(--border-interactive);
}

.btn-primary:disabled,
.btn-primary:disabled:hover {
    background: var(--accent);
}

/* --- 3.10 Sidebar Footer --- */
.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-footer a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.78rem;
    transition: color 0.2s ease;
}

.sidebar-footer a:hover {
    color: var(--text-secondary);
}



/* --- 4. MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    min-width: 0;
    margin-left: calc(var(--sidebar-width) + 1px);
    margin-right: calc(var(--right-sidebar-width) + 1px);
    padding: 40px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- 4.1 Preview Header --- */
.preview-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 32px;
}

.preview-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin: 0;
}

/* --- 4.2 Card Grid --- */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    justify-items: center;
}

/* --- 4.3 Card Canvas --- */
.card-canvas {
    max-width: 100%;
    height: auto;
    background: var(--card-bg);
    border-radius: 50%;
    box-shadow: var(--shadow-card);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.4s ease;
}

.card-canvas:hover {
    transform: scale(1.04);
    box-shadow: var(--shadow-card-hover);
}

/* Card Appear Animation */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card-canvas.animate-in {
    animation: cardAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* --- 4.4 Info Text --- */
.info-text {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 32px;
    display: flex;
    align-items: center;
    font-style: normal;
}

/* --- 5. MODAL (Impressum) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    color: var(--text-primary);
    padding: 28px 32px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    color: var(--text-tertiary);
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-primary);
    text-decoration: none;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-content p {
    margin: 8px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.modal-content p strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- 6. UNUSED IMAGES INFO --- */
.unused-images-info {
    background: var(--warning-subtle);
    border: 1px solid rgba(200, 155, 46, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
    font-size: 0.8rem;
}

.unused-images-info h4 {
    margin: 0 0 8px 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--warning);
}

.unused-images-info ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
    color: var(--text-secondary);
    max-height: 140px;
    overflow-y: auto;
}

.unused-images-info ul li {
    padding: 2px 0;
    word-break: break-all;
    font-size: 0.78rem;
}

/* --- 7. IMAGE TABLE --- */
.image-table-container {
    margin-top: 2.5rem;
    width: 100%;
    max-width: 1200px;
    overflow-x: auto;
}

.image-name-table {
    width: auto;
    margin: 0 auto;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.image-name-table th,
.image-name-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.image-name-table th {
    background-color: var(--bg-surface-hover);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    white-space: nowrap;
}

.image-name-table td {
    font-size: 0.85rem;
}

.image-name-table td:nth-child(odd) {
    width: 80px;
    text-align: center;
}

.image-name-table td:nth-child(even) {
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 24px;
}

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

.image-name-table tbody tr {
    transition: background 0.15s ease;
}

.image-name-table tbody tr:hover td {
    background: var(--bg-surface-hover);
}

.table-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: contain;
    vertical-align: middle;
    border-radius: 6px;
}

/* --- 8. ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.sidebar>* {
    animation: fadeInUp 0.4s ease both;
}

.sidebar>*:nth-child(1) {
    animation-delay: 0.05s;
}

.sidebar>*:nth-child(2) {
    animation-delay: 0.10s;
}

.sidebar>*:nth-child(3) {
    animation-delay: 0.15s;
}

.sidebar>*:nth-child(4) {
    animation-delay: 0.20s;
}

.sidebar>*:nth-child(5) {
    animation-delay: 0.25s;
}

.sidebar>*:nth-child(6) {
    animation-delay: 0.30s;
}

.sidebar>*:nth-child(7) {
    animation-delay: 0.35s;
}

.sidebar>*:nth-child(8) {
    animation-delay: 0.40s;
}

.sidebar>*:nth-child(9) {
    animation-delay: 0.45s;
}

.sidebar>*:nth-child(10) {
    animation-delay: 0.50s;
}

/* --- 9. ADS & COOKIE BANNER --- */
.right-sidebar {
    width: var(--right-sidebar-width);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-left: 1px solid var(--border-subtle);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.ad-placeholder {
    background: var(--bg-surface-hover);
    border: 1px dashed var(--border-interactive);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ad-placeholder.vertical {
    height: 100%;
    min-height: 600px;
}

.bottom-ad-container {
    width: 100%;
    max-width: 960px;
    margin: 40px auto 0;
}

.bottom-ad-container .ad-placeholder {
    height: 90px;
    width: 100%;
}

.ad-label {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    opacity: 0.7;
}



/* --- 10. RESPONSIVE --- */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }

    .main-content {
        margin-right: 0;
    }

    .right-sidebar {
        position: relative;
        width: auto;
        margin-left: calc(var(--sidebar-width) + 1px);
        border-left: none;
        border-top: 1px solid var(--border-subtle);
    }

    .ad-placeholder.vertical {
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        order: 1;
    }

    .container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        margin-right: 0;
        padding: 24px 16px;
        order: 3;
    }

    .preview-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    .right-sidebar {
        position: relative;
        width: 100%;
        margin-left: 0;
        border-left: none;
        border-top: none;
        border-bottom: 1px solid var(--border-subtle);
        order: 2;
    }
}
