/* PRDGY Web v2 — Custom styles on top of Tailwind */

/* Prevent pull-to-refresh on mobile */
html, body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar — desktop only */
@media (min-width: 1024px) {
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: #0a0a0a; }
    ::-webkit-scrollbar-thumb { background: #262626; border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: #404040; }
}

/* Upload zone drag over */
#upload-zone.drag-over {
    border-color: #e5e5e5;
    background: rgba(229, 229, 229, 0.05);
}

/* --- Chip Radio (settings) --- */
.chip-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 0.75rem;
    border: 1px solid #262626;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    color: #a3a3a3;
    text-align: center;
    user-select: none;
}
.chip-radio:hover {
    border-color: #525252;
    color: #e5e5e5;
}
.chip-radio.active,
.chip-radio:has(input:checked) {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* --- Chip Toggle (suggestion chips) --- */
.chip-toggle {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 0.7rem;
    border: 1px solid #262626;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    color: #a3a3a3;
    background: transparent;
    white-space: nowrap;
}
.chip-toggle:hover {
    border-color: #525252;
    color: #e5e5e5;
}
.chip-toggle.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Chip add button */
.chip-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    border: 1px dashed #404040;
    border-radius: 20px;
    cursor: pointer;
    color: #737373;
    transition: all 0.15s;
    background: transparent;
}
.chip-add:hover {
    border-color: #737373;
    color: #e5e5e5;
}

/* --- Template Cards --- */
.template-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #262626;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: #141414;
    width: 100%;
    text-align: left;
}
.template-card:hover {
    border-color: #525252;
}
.template-card.active {
    border-color: #fff;
    background: #1a1a1a;
}
.template-accent {
    width: 4px;
    height: 28px;
    border-radius: 2px;
    flex-shrink: 0;
}
.template-emoji {
    font-size: 1rem;
    flex-shrink: 0;
}
.template-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.template-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.template-vibe {
    font-size: 0.65rem;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Model Badge --- */
.model-badge {
    font-size: 0.6rem;
    padding: 1px 6px;
    background: #262626;
    border-radius: 4px;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Prompt card --- */
.prompt-card {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 0.5rem;
    padding: 0.875rem;
    transition: border-color 0.2s;
}
.prompt-card:hover {
    border-color: #404040;
}

/* --- Progress bar --- */
.progress-bar {
    height: 3px;
    background: #262626;
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: #e5e5e5;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* --- Result card --- */
.result-card img.result-img {
    transition: transform 0.3s ease, filter 0.3s ease;
}
.result-card:hover img.result-img {
    transform: scale(1.02);
}

/* --- Edit Toolbar --- */
.edit-toolbar {
    border-top: 1px solid #262626;
    padding-top: 8px;
    margin-top: 8px;
}
.edit-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.edit-tool-btn {
    font-size: 0.65rem;
    padding: 4px 8px;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    color: #a3a3a3;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.edit-tool-btn:hover {
    border-color: #666;
    color: #fff;
}

.edit-options-panel {
    margin-top: 4px;
}

.edit-option-chip {
    font-size: 0.65rem;
    padding: 4px 10px;
    border: 1px solid #333;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    color: #a3a3a3;
    background: transparent;
}
.edit-option-chip:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* --- Generating spinner --- */
@keyframes pulse-border {
    0%, 100% { border-color: #262626; }
    50% { border-color: #525252; }
}
.generating {
    animation: pulse-border 2s ease-in-out infinite;
}

/* --- Mobile adjustments --- */
@media (max-width: 1023px) {
    select, input[type="text"], textarea {
        font-size: 16px !important;
        min-height: 44px;
    }
    button {
        min-height: 44px;
    }
    .chip-radio {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .chip-toggle {
        min-height: 32px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    .edit-tool-btn {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    .edit-option-chip {
        min-height: 32px;
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    .template-card {
        min-height: 44px;
    }
    .suggestion-category button {
        min-height: 44px;
    }
    .suggestion-category label {
        min-height: 40px;
        display: flex;
        align-items: flex-start;
    }
    .suggestion-check {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }
}

/* Desktop: sidebar fixed height */
@media (min-width: 1024px) {
    aside {
        max-height: calc(100vh - 57px);
    }
}
