/* Release Generator page — replaces Tailwind utilities */

/* ----- Page chrome ----- */
.release-generator-page {
    background: #f3f4f6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.page-shell {
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

@media (min-width: 1024px) {
    .page-shell {
        flex-direction: row;
    }
}

/* ----- Controls column ----- */
.controls-column {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .controls-column {
        width: 33.333%;
        min-width: 360px;
        border-bottom: none;
        border-right: 1px solid #e5e7eb;
    }
}

.controls-body {
    padding: 1rem;
    overflow-y: auto;
    padding-bottom: 6rem;
}

@media (min-width: 640px) {
    .controls-body {
        padding: 1.5rem;
        padding-bottom: 6rem;
    }
}

.controls-section {
    margin-bottom: 2rem;
}

.controls-section + .controls-section {
    padding-top: 0;
}

/* ----- Section intro ----- */
.section-intro {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 1.5rem;
}

/* ----- Section headers ----- */
.section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* ----- Form elements ----- */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-label-sm {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-hint {
    font-size: 0.625rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.form-field {
    margin-bottom: 1rem;
}

.input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.input:focus {
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.input-mono {
    font-family: monospace;
    font-size: 0.75rem;
    color: #4b5563;
}

.input-sm {
    font-size: 0.875rem;
}

.input-xs {
    font-size: 0.75rem;
}

.input-narrow {
    width: 6rem;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}

/* ----- Row / flex utilities ----- */
.row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.row-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.row-end {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flex-1 {
    flex: 1;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ----- Buttons ----- */
.btn-gen {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-gen-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none;
}

.btn-black {
    background: #000;
    color: #fff;
}

.btn-black:hover {
    background: #262626;
}

.btn-blue {
    background: #2563eb;
    color: #fff;
}

.btn-blue:hover {
    background: #1d4ed8;
}

.btn-gray {
    background: #e5e7eb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-gray:hover {
    background: #d1d5db;
}

.btn-gray:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-green {
    background: #22c55e;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-green:hover {
    background: #16a34a;
}

.btn-ghost {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s;
}

.btn-ghost:hover {
    color: #2563eb;
}

.btn-outline {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.btn-outline:hover {
    background: #f9fafb;
}

/* ----- Upload button ----- */
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    background: #e5e7eb;
    color: #374151;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    transition: background 0.15s;
    white-space: nowrap;
}

.upload-btn:hover {
    background: #d1d5db;
}

/* ----- Link-row (platform + input + open-btn) ----- */
.link-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.link-row-logo {
    height: 1rem;
    width: 4rem;
    object-fit: contain;
    opacity: 0.5;
    flex-shrink: 0;
}

.link-row-inputs {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ----- Panel boxes ----- */
.panel-box {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.panel-box-info {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

/* ----- Toggle switch ----- */
.toggle-wrap {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-wrap input[type="checkbox"] {
    display: none;
}

.toggle-track {
    position: relative;
    width: 2.25rem;
    height: 1.25rem;
    background: #e5e7eb;
    border-radius: 9999px;
    transition: background 0.2s;
}

.toggle-wrap input:checked + .toggle-track {
    background: #000;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    border: 1px solid #d1d5db;
}

.toggle-wrap input:checked + .toggle-track::after {
    transform: translateX(1rem);
    border-color: #fff;
}

.toggle-label {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #4b5563;
}

/* ----- Preview section ----- */
.preview-section {
    flex: 1;
    background: #f3f4f6;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (min-width: 640px) {
    .preview-section {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .preview-section {
        padding: 2rem;
    }
}

.preview-toolbar {
    width: 100%;
    max-width: 56rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(243,244,246,0.95);
    padding-bottom: 0.5rem;
    backdrop-filter: blur(4px);
}

@media (min-width: 1024px) {
    .preview-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        position: static;
        background: transparent;
        backdrop-filter: none;
        gap: 0;
    }
}

.preview-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}

.phone-frame {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 9/19;
    background: #111827;
    border-radius: 26px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    border: 5px solid #1f2937;
    overflow: hidden;
    outline: 1px solid rgba(229,231,235,0.5);
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .phone-frame {
        border-radius: 28px;
        border-width: 6px;
    }
}

@media (min-width: 1024px) {
    .phone-frame {
        max-width: 320px;
        border-radius: 30px;
    }
}

/* ----- Toggle preview button (mobile only) ----- */
.toggle-preview-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    background: #000;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    font-size: 0.875rem;
    font-weight: 600;
}

.toggle-preview-btn:active {
    transform: scale(0.95);
}

@media (min-width: 1024px) {
    .toggle-preview-btn {
        display: none;
    }
}

/* ----- Success modal ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.2s;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 28rem;
    width: calc(100% - 2rem);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    border: 1px solid #e5e7eb;
}

.modal-icon {
    width: 3rem;
    height: 3rem;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.modal-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem;
}

.modal-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.url-container {
    display: flex;
    gap: 0.5rem;
    background: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    align-items: center;
    margin: 1rem 0 0.25rem;
    transition: border-color 0.15s;
}

.url-prefix {
    font-size: 0.75rem;
    color: #9ca3af;
    padding-left: 0.5rem;
    user-select: none;
}

.slug-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
    outline: none;
    padding: 0;
}

.slug-input:disabled {
    opacity: 0.5;
}

.slug-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
    text-align: left;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-modal-close {
    width: 100%;
    padding: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-modal-close:hover {
    background: #e5e7eb;
}

.btn-modal-open {
    width: 100%;
    padding: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.btn-modal-open:hover {
    background: #1d4ed8;
}

/* ----- Text utilities ----- */
.text-muted {
    color: #6b7280;
    font-size: 0.875rem;
}

.text-muted-xs {
    color: #9ca3af;
    font-size: 0.75rem;
    font-style: italic;
}

.text-hint {
    color: #9ca3af;
    font-size: 0.625rem;
}

.hidden-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* ----- Color swatches (design section) ----- */
.swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding-top: 0.25rem;
}

.swatch-wrap {
    cursor: pointer;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.swatch-wrap input[type="radio"] {
    display: none;
}

.swatch-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    transition: border-color 0.15s, transform 0.15s;
}

.swatch-wrap input:checked + .swatch-circle {
    border-color: #000;
    transform: scale(1.1);
}

.swatch-label {
    font-size: 0.5625rem;
    color: #6b7280;
    opacity: 0;
    position: absolute;
    bottom: -1.25rem;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    transition: opacity 0.15s;
    pointer-events: none;
}

.swatch-wrap:hover .swatch-label {
    opacity: 1;
}

/* ----- JS-toggled state utilities (used by release-generator.js) ----- */
.hidden { display: none !important; }
.flex { display: flex !important; }
.rotate-180 { transform: rotate(180deg); }
#previewToggleIcon { display: inline-block; transition: transform 0.2s; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.cursor-not-allowed { cursor: not-allowed; }

/* Background overrides (JS swaps these on buttons) */
.bg-black { background: #000 !important; }
.bg-white { background: #fff !important; }
.bg-gray-50 { background: #f9fafb !important; }
.bg-gray-200 { background: #e5e7eb !important; }
.bg-red-500 { background: #ef4444 !important; }
.bg-red-600 { background: #dc2626 !important; }
.bg-green-600 { background: #16a34a !important; }
.bg-blue-600 { background: #2563eb !important; }

/* Color overrides */
.text-white { color: #fff !important; }
.text-gray-500 { color: #6b7280; }
.text-gray-700 { color: #374151; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }

/* Ring (focus outline) for urlContainer editing */
.ring-2.ring-blue-500 { box-shadow: 0 0 0 2px #3b82f6; }
