/* public/assets/css/style.css - Mirage 2026 Redesign */
:root {
    --bg-main: #000000;
    --bg-sidebar: #0a0a0a;
    --bg-card: #121212;
    --bg-input: #1a1a1a;
    --bg-hover: #222222;

    --border: #2a2a2a;
    --border-light: #333333;

    --accent: #ffffff;
    /* Primary action is often white in these dark UIs */
    --accent-primary: #00e599;
    /* Keeping brand color for specific highlights */

    --text-main: #ffffff;
    --text-muted: #888888;
    --text-discreet: #555555;

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --nav-width: 250px;
    /* Global Sidebar */
    --controls-width: 320px;
    /* Generator Controls */

    --transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
    outline: none;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 14px;
    overflow: hidden;
    /* App-like feel */
    height: 100vh;
}

/* --- Layout Structure --- */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* 1. Global Navigation Sidebar */
.global-nav {
    width: var(--nav-width);
    background: var(--bg-main);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
}

.global-nav .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #fff;
    padding-left: 10px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-discreet);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    margin-bottom: 2px;
}

.nav-item:hover {
    color: #fff;
    background: var(--bg-hover);
}

.nav-item.active {
    color: #fff;
    background: var(--bg-input);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* 2. Main Generation Area */
.studio-container {
    flex: 1;
    display: flex;
    min-width: 0;
    /* Prevent overflow */
}

/* Controls Sidebar (Left Panel of Content) */
.controls-sidebar {
    width: var(--controls-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    flex-shrink: 0;
}

/* Controls Components */
.control-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}

/* Custom Select */
.custom-select {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.custom-select:hover {
    border-color: var(--border-light);
}

/* Reference Cards */
.ref-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.ref-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
}

.ref-card:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.ref-card i {
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--text-main);
}

.ref-card span {
    font-size: 10px;
    color: var(--text-muted);
}

.import-dropzone {
    background: var(--bg-input);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.import-dropzone:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: #fff;
}

.import-dropzone i {
    font-size: 20px;
}

.import-dropzone span {
    font-size: 11px;
    font-weight: 600;
}

/* Textarea */
/* Textarea / Prompt area */
.prompt-container {
    background: #0d0d0d;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--border);
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    margin-bottom: 20px;
}

.prompt-container:focus-within {
    border-color: #3d7eff;
    box-shadow: 0 0 0 3px rgba(61, 126, 255, 0.1);
}

.prompt-area {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.prompt-area::placeholder {
    color: #555;
}

/* Specific position for app.js suggestions button */
.controls-sidebar .fa-lightbulb {
    color: #000;
}


/* Number Inputs */
/* Number / Setting Controls */
.number-control {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    min-height: 40px;
}

.number-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.number-btn:hover {
    background: #222;
    color: #fff;
    border-radius: 6px;
}

.number-display {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

/* Radio Pill Styling */
.radio-pill {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.radio-pill:hover {
    border-color: var(--border-light);
    background: #151515;
}

.radio-pill.selected {
    background: #3d7eff15;
    border-color: #3d7eff;
    color: #fff;
}

/* Voice Card Styling */
.voice-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 12px;
}

.voice-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.voice-card.selected {
    background: rgba(0, 255, 157, 0.05);
    border-color: var(--accent);
}

.voice-card.selected i {
    color: var(--accent);
}

.voice-card span {
    font-size: 11px;
    font-weight: 600;
}

/* Custom Range Input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    /* Standard property */
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #3d7eff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(61, 126, 255, 0.3);
}

input[type="range"]#speed-slider::-webkit-slider-thumb {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

/* Generate Button */
/* Generate Button */
.btn-generate {
    background: #1a1a1a;
    color: var(--text-muted);
    border: none;
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: not-allowed;
    margin-top: auto;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-generate.ready {
    background: #3d7eff;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(61, 126, 255, 0.3);
}

.btn-generate.ready:hover {
    transform: translateY(-2px);
    background: #4d8cff;
    box-shadow: 0 6px 20px rgba(61, 126, 255, 0.4);
}

.btn-generate i {
    font-size: 18px;
}

/* 3. Inspiration / Results Area (Right Panel) */
.results-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #000;
    position: relative;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    border-bottom: 1px solid var(--border);
}

.header-tabs {
    display: flex;
    gap: 5px;
    background: #000;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.header-tab {
    flex: 1;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: transparent;
    border-radius: 8px;
    text-align: center;
}

.header-tab.active {
    background: var(--bg-input);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-tab:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Sub-nav Bar Styling */
.sub-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 40px;
    border-bottom: 1px solid var(--border);
    background: #0a0a0a;
}

.sub-nav-left,
.sub-nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dropdown-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
}

.sub-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.sub-nav-item:hover {
    color: #fff;
}

.action-icons {
    display: flex;
    gap: 5px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.action-btn.active {
    background: #333;
    color: #fff;
}

.freepik-btn {
    background: #3d7eff !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    box-shadow: 0 4px 15px rgba(61, 126, 255, 0.3);
}

.freepik-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 126, 255, 0.4);
}


.results-actions button:hover {
    background: var(--bg-hover);
}

/* Masonry Grid */
.masonry-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 40px 40px;
}

.masonry-grid {
    columns: 3 300px;
    column-gap: 20px;
    margin-top: 20px;
    transition: var(--transition);
}

/* Specific Column counts when set via class */
.masonry-grid.columns-2 {
    columns: 2 !important;
}

.masonry-grid.columns-3 {
    columns: 3 !important;
}

.masonry-grid.columns-4 {
    columns: 4 !important;
}

.masonry-grid.columns-5 {
    columns: 5 !important;
}

/* List View Styling */
.masonry-grid.list-view {
    display: flex;
    flex-direction: column;
    columns: unset;
}

.masonry-grid.list-view .grid-item {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 15px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    cursor: default;
}

.masonry-grid.list-view .grid-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.masonry-grid.list-view .grid-item video {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.masonry-grid.list-view .grid-item .item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.masonry-grid.list-view .grid-item .item-prompt {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
}

.masonry-grid.list-view .grid-item .item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.masonry-grid.list-view .grid-overlay {
    position: static;
    opacity: 1;
    background: none;
    padding: 0;
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    background: var(--bg-card);
}

.grid-item img {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
    transition: transform 0.3s ease;
}

.grid-item:hover img {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.grid-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 10;
}

.grid-item:hover .grid-overlay {
    opacity: 1;
    pointer-events: auto;
}

.grid-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

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

.grid-btn.fav-btn.active {
    color: #ff4d4d;
}

/* Fullscreen results area */
.results-area.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
}

/* Search Input styling in sub-nav */
.search-container {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0 15px;
    height: 38px;
    width: 0;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
    opacity: 0;
}

.search-container.active {
    width: 250px;
    opacity: 1;
}

.search-container input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
    width: 100%;
}

/* Empty State / Search */
.inspiration-search {
    margin-top: 10px;
    margin-bottom: 30px;
}

.search-title {
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 600;
}

.pill-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-main);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.pill:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex-spacer {
    flex: 1;
}

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

.mt-4 {
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    .controls-sidebar {
        width: 280px;
    }

    .masonry-grid {
        columns: 3 200px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    .global-nav {
        width: 100%;
        height: auto;
        padding: 12px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 100;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .global-nav .logo {
        margin-bottom: 0;
    }

    .nav-section {
        display: none;
    }

    /* On mobile maybe hide sidebar or use burger menu */
    .controls-sidebar {
        width: 100%;
    }

    .results-area {
        height: auto;
        padding-bottom: 80px;
    }

    .masonry-scroll {
        padding: 10px;
        overflow: visible;
    }

    .masonry-grid {
        columns: 2 160px;
    }
}