/* Local Font Face Declarations */
@font-face {
    font-family: 'ITCGaramondStd';
    src: url('fonts/ITCGaramondStd/ITCGaramondStd-LtNarrow.woff2') format('woff2'),
        url('fonts/ITCGaramondStd/ITCGaramondStd-LtNarrow.woff') format('woff'),
        url('fonts/ITCGaramondStd/ITCGaramondStd-LtNarrow.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TBWAGrotesk';
    src: url('fonts/TBWAGrotesk/TBWAGrotesk-Regular.woff2') format('woff2'),
        url('fonts/TBWAGrotesk/TBWAGrotesk-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TBWAGrotesk';
    src: url('fonts/TBWAGrotesk/TBWAGrotesk-Medium.woff2') format('woff2'),
        url('fonts/TBWAGrotesk/TBWAGrotesk-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TBWAGrotesk';
    src: url('fonts/TBWAGrotesk/TBWAGrotesk-SemiBold.woff2') format('woff2'),
        url('fonts/TBWAGrotesk/TBWAGrotesk-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TBWAGrotesk';
    src: url('fonts/TBWAGrotesk/TBWAGrotesk-Bold.woff2') format('woff2'),
        url('fonts/TBWAGrotesk/TBWAGrotesk-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TBWAGrotesk';
    src: url('fonts/TBWAGrotesk/TBWAGrotesk-Black.woff2') format('woff2'),
        url('fonts/TBWAGrotesk/TBWAGrotesk-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Custom overrides for brutalist strictness */
* {
    border-radius: 0 !important;
}

.backslash-divider::before {
    content: '\\';
    font-family: 'TBWAGrotesk', sans-serif;
    font-weight: 900;
    color: #ffd515;
    margin-right: 0.5rem;
}

/* ==========================================================================
   Editorial Brutalist Dark Mode Inversion Rules
   ========================================================================== */
.dark body {
    background-color: #111212 !important;
    color: #eeeeee !important;
}

/* Semantics: Surface lowest (cards, containers) in dark mode */
.dark .bg-surface-container-lowest {
    background-color: #1c1d1d !important;
}

/* Semantics: Surface containers (grids, dropzone fallback) in dark mode */
.dark .bg-surface-container {
    background-color: #131414 !important;
}

/* Borders */
.dark .border-surface-variant {
    border-color: #2f3131 !important;
}

.dark .border-on-surface {
    border-color: #474747 !important;
}

.dark .border-b.border-on-surface {
    border-color: #474747 !important;
}

.dark .border-t.border-surface-variant {
    border-color: #2f3131 !important;
}

.dark .border-b.border-surface-variant {
    border-color: #2f3131 !important;
}

/* Headings & Text */
.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark .text-on-surface {
    color: #ffffff !important;
}

.dark .text-on-surface-variant,
.dark .text-on-secondary-container {
    color: #a09e95 !important;
}

/* Inputs & Form Overrides */
.dark input,
.dark select,
.dark textarea {
    color: #000000 !important;
    border-color: #eeeeee !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #5e5f5a !important;
}

/* Drag & Drop */
.dark .border-2.border-dashed.border-on-surface {
    border-color: #eeeeee !important;
    background-color: #131414 !important;
}

/* Buttons */
.dark button.bg-on-surface {
    background-color: #eeeeee !important;
    color: #1a1c1c !important;
}

.dark button.bg-on-surface:hover {
    background-color: #ffd515 !important;
    color: #1a1c1c !important;
}

.dark button.bg-primary-container {
    background-color: #ffd515 !important;
    color: #1a1c1c !important;
}

.dark button.bg-primary-container:hover {
    border-color: #eeeeee !important;
}

.dark button.bg-transparent {
    color: #eeeeee !important;
    border-color: #eeeeee !important;
}

.dark button.bg-transparent:hover {
    background-color: #2f3131 !important;
}

.dark button.bg-surface-variant {
    background-color: #2f3131 !important;
    color: #a09e95 !important;
}

/* Sidebar Utilities */
.dark a {
    color: #eeeeee !important;
}

.dark a:hover {
    color: #ffd515 !important;
}

/* Toasts Adaptations */
.dark .bg-primary-container.text-on-surface {
    background-color: #ffd515 !important;
    color: #1a1c1c !important;
}

.dark .bg-on-surface.text-surface-container-lowest {
    background-color: #eeeeee !important;
    color: #1a1c1c !important;
}

.dark .text-surface-variant {
    color: #474747 !important;
}

.dark .border-t-primary-container {
    border-top-color: #ffd515 !important;
}

/* Specimen switcher button adjustment */
.dark button[onclick*="switchAssetColor"] {
    border-color: #474747 !important;
}

/* ==========================================================================
   Semantic Component Classes (Reducing HTML Class Bloat)
   ========================================================================== */

/* --- Buttons --- */
.button {
    background-color: #1a1c1c;
    color: #ffffff;
    font-family: 'TBWAGrotesk', sans-serif;
    font-size: 12px;
    line-height: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 14px;
    justify-self: start;
    align-self: start;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
    border: none;
}

.button:hover {
    background-color: #ffd515;
    color: #1a1c1c;
}

.dark .button {
    background-color: #eeeeee;
    color: #1a1c1c;
}

.dark .button:hover {
    background-color: #ffd515;
    color: #1a1c1c;
}

/* --- Button Modifiers --- */
.button.featured {
    background-color: #ffd515;
    color: #1a1c1c;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.button.featured:hover {
    background-color: #ffd515;
    color: #1a1c1c;
    border-color: #1a1c1c;
}

.dark .button.featured {
    background-color: #ffd515;
    color: #1a1c1c;
}

.dark .button.featured:hover {
    border-color: #eeeeee;
}

.button.secondary {
    background-color: transparent;
    color: #1a1c1c;
    border: 1px solid #1a1c1c;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.button.secondary:hover {
    background-color: #eeeeee;
    color: #1a1c1c;
}

.dark .button.secondary {
    color: #eeeeee;
    border-color: #eeeeee;
    background-color: transparent;
}

.dark .button.secondary:hover {
    background-color: #2f3131;
    color: #eeeeee;
}

.button.disable,
.button.disabled {
    background-color: #e2e2e2;
    color: #4d4632;
    opacity: 0.5;
    cursor: not-allowed;
    border: none;
}

.button.disable:hover,
.button.disabled:hover {
    background-color: #e2e2e2;
    color: #4d4632;
}

.dark .button.disable,
.dark .button.disabled {
    background-color: #2f3131;
    color: #a09e95;
}

.dark .button.disable:hover,
.dark .button.disabled:hover {
    background-color: #2f3131;
    color: #a09e95;
}

/* --- Headlines & Titles --- */
.headline {
    font-family: 'ITCGaramondStd', serif;
    font-size: 64px;
    line-height: 0.9;
    letter-spacing: -0.03em;
    max-width: 64rem;
}

@media (min-width: 768px) {
    .headline {
        font-size: 100px;
    }
}

.section-title {
    font-family: 'TBWAGrotesk', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid #1a1c1c;
    padding-bottom: 8px;
    margin-bottom: 32px;
}

.dark .section-title {
    border-color: #eeeeee;
}

.headline-lg {
    font-family: 'ITCGaramondStd', serif;
    font-size: 64px;
    line-height: 1;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .headline-lg {
        font-size: 96px;
    }
}

.headline-md {
    font-size: 24px;
    line-height: 1.2;
}

.headline-sm {
    font-family: 'ITCGaramondStd', serif;
    font-size: 18px;
    line-height: 1.25;
}

/* --- Inputs --- */
.text-input,
.select-input,
.textarea-input {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #1a1c1c;
    padding: 8px 0;
    font-family: 'TBWAGrotesk', sans-serif;
    font-size: 14px;
    border-radius: 0 !important;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
    outline: none;
    border-color: #ffd515;
    box-shadow: none !important;
}

.dark .text-input,
.dark .select-input,
.dark .textarea-input {
    color: #ffffff;
    border-color: #eeeeee;
}

.text-input::placeholder,
.textarea-input::placeholder {
    color: #dadada;
}

.dark .text-input::placeholder,
.dark .textarea-input::placeholder {
    color: #5e5f5a;
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
}

.drag-drop-zone {
    border: 2px dashed #1a1c1c;
    padding: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #eeeeee;
    transition: background-color 0.2s;
    cursor: pointer;
}

.drag-drop-zone:hover {
    background-color: rgba(255, 213, 21, 0.1);
}

.dark .drag-drop-zone {
    border-color: #eeeeee;
    background-color: #131414;
}

.dark .drag-drop-zone:hover {
    background-color: rgba(255, 213, 21, 0.1);
}

/* --- Typo Stamps --- */
.typo-stamp {
    font-family: 'TBWAGrotesk', sans-serif;
    font-size: 10px;
    line-height: 17px;
    text-transform: uppercase;
    font-weight: 400;
    text-align: center;
    border: 1px solid #1a1c1c;
    background-color: #ffffff;
    color: #1a1c1c;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
    cursor: default;
    user-select: none;
}

.typo-stamp:hover {
    background-color: #ffd515;
    border-color: #1a1c1c;
    color: #1a1c1c;
    transform: translateY(-2px);
}

.dark .typo-stamp {
    background-color: #1c1d1d;
    border-color: #2f3131;
    color: #ffffff;
}

.dark .typo-stamp:hover {
    background-color: #ffd515;
    border-color: #ffd515;
    color: #1a1c1c;
}

/* --- Loading Animations --- */
.loading-card {
    border: 1px solid #1a1c1c;
    background-color: #ffffff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
    cursor: default;
    box-sizing: border-box;
}

.loading-card:hover {
    transform: translateY(-2px);
    background-color: #ffd515;
}

.loading-label {
    font-family: 'TBWAGrotesk', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 16px;
    color: #1a1c1c;
    transition: color 0.2s;
    text-align: center;
}

.dark .loading-card {
    background-color: #1c1d1d;
    border-color: #2f3131;
}

.dark .loading-card:hover {
    background-color: #ffd515;
    border-color: #ffd515;
}

.dark .loading-label {
    color: #ffffff;
}

.dark .loading-card:hover .loading-label {
    color: #1a1c1c;
}

/* ==========================================================================
   Image Generator (Flow UI) Custom Styles
   ========================================================================== */
.generator-prompt-bar {
    position: relative;
    background-color: #ffffff;
    border: 2px solid #1a1c1c;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 4px 4px 0px 0px #1a1c1c;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.dark .generator-prompt-bar {
    background-color: #1c1d1d;
    border-color: #2f3131;
    box-shadow: 4px 4px 0px 0px #ffd515;
}

.generator-prompt-bar:focus-within {
    border-color: #ffd515;
}

.prompt-drag-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 213, 21, 0.95);
    color: #1a1c1c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'TBWAGrotesk', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.generator-prompt-bar.dragover .prompt-drag-overlay {
    opacity: 1;
}

/* Reference image thumbnail preview in input bar */
.ref-image-thumb-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid #1a1c1c;
}

.dark .ref-image-thumb-wrapper {
    border-color: #2f3131;
}

.ref-image-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ref-image-thumb-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background-color: #ba1a1a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    border: 1px solid #1a1c1c;
}

/* Popover UI Bubble */
.generator-popover {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 50px;
    width: 320px;
    background-color: #ffffff;
    border: 2px solid #1a1c1c;
    padding: 16px;
    color: #1a1c1c;
    z-index: 30;
    box-shadow: 6px 6px 0px 0px #1a1c1c;
    display: none;
    flex-direction: column;
    gap: 16px;
}

.generator-popover.active {
    display: flex;
}

.dark .generator-popover {
    background-color: #1c1d1d;
    border-color: #2f3131;
    color: #ffffff;
    box-shadow: 6px 6px 0px 0px #ffd515;
}

/* Ratio selector elements */
.ratio-selector-grid {
    display: grid;
    grid-template-cols: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.ratio-option-btn {
    background-color: #eeeeee;
    border: 1px solid #c6c6c6;
    color: #1a1c1c;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.dark .ratio-option-btn {
    background-color: #2f3131;
    border-color: #474747;
    color: #ffffff;
}

.ratio-option-btn:hover,
.ratio-option-btn.active {
    background-color: #ffd515 !important;
    border-color: #1a1c1c !important;
    color: #1a1c1c !important;
}

.dark .ratio-option-btn:hover,
.dark .ratio-option-btn.active {
    background-color: #ffd515 !important;
    border-color: #ffd515 !important;
    color: #1a1c1c !important;
}

.ratio-visual-box {
    border: 2px solid currentColor;
    background-color: transparent;
    transition: border-color 0.2s;
}

/* Custom aspect boxes */
.visual-16-9 { width: 24px; height: 14px; }
.visual-4-3 { width: 22px; height: 16px; }
.visual-1-1 { width: 18px; height: 18px; }
.visual-3-4 { width: 16px; height: 22px; }
.visual-9-16 { width: 14px; height: 24px; }

/* Count Option buttons */
.count-option-btn {
    background-color: #eeeeee;
    border: 1px solid #c6c6c6;
    color: #1a1c1c;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.dark .count-option-btn {
    background-color: #2f3131;
    border-color: #474747;
    color: #ffffff;
}

.count-option-btn:hover,
.count-option-btn.active {
    background-color: #ffd515 !important;
    border-color: #1a1c1c !important;
    color: #1a1c1c !important;
}

.dark .count-option-btn:hover,
.dark .count-option-btn.active {
    background-color: #ffd515 !important;
    border-color: #ffd515 !important;
    color: #1a1c1c !important;
}

/* Toggle Tabs for Görüntü/Video */
.popover-toggle-tabs {
    display: flex;
    background-color: #eeeeee;
    border: 1px solid #c6c6c6;
    padding: 2px;
}

.dark .popover-toggle-tabs {
    background-color: #131414;
    border-color: #2f3131;
}

.popover-tab-btn {
    flex: 1;
    padding: 6px 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    color: #5e5e5e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.dark .popover-tab-btn {
    color: #a09e95;
}

.popover-tab-btn.active {
    background-color: #1a1c1c;
    color: #ffffff;
}

.dark .popover-tab-btn.active {
    background-color: #eeeeee;
    color: #1a1c1c;
}

/* Generator Image Cards in results grid */
.generator-image-card {
    position: relative;
    border: 1px solid #1a1c1c;
    background-color: #eeeeee;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dark .generator-image-card {
    border-color: #2f3131;
    background-color: #131414;
}

.generator-image-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.generator-image-card:hover img {
    transform: scale(1.02);
}

.generator-image-actions {
    position: absolute;
    inset: 0;
    background-color: rgba(26, 28, 28, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.generator-image-card:hover .generator-image-actions {
    opacity: 1;
}