/* ==========================================================================
   Favicon Factory - Tool-Specific Styles
   
   IMPORTANT: The design system already provides:
   - All colors via CSS variables
   - Nav, hero, buttons, inputs, file upload zones
   - Section spacing and layout
   
   DO NOT:
   - Add background colors to .input-section or .output-section
   - Add borders to sections
   - Add padding to sections (use input-group for internal spacing)
   - Override design system colors
   ========================================================================== */

/* === INPUT MODE TABS === */
.input-mode-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.mode-tab {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-default);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.mode-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.mode-tab.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* === EMOJI INPUT === */
.emoji-input {
    font-size: 32px;
    text-align: center;
    height: 80px;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', emoji;
}

/* === COLOR INPUT GROUP === */
.color-input-group {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.color-picker {
    width: 50px;
    height: 50px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: none;
}

.color-text {
    flex: 1;
    min-width: 100px;
    font-family: monospace;
    text-transform: uppercase;
}

.button-secondary.small {
    padding: var(--space-xs) var(--space-sm);
    font-size: 12px;
    white-space: nowrap;
}

/* === SETTING ROWS === */
.setting-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.setting-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* === SLIDER STYLING === */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    margin: var(--space-xs) 0;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === PRO SETTINGS === */
.pro-setting {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.pro-setting.pro-locked .slider {
    cursor: not-allowed;
}

.is-pro .pro-setting {
    opacity: 1;
}

/* === INPUT HELP TEXT === */
.input-help {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* === PREVIEW AREA === */
.preview-container {
    min-height: 300px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Empty state */
.preview-empty {
    text-align: center;
    color: var(--text-tertiary);
}

.preview-empty p {
    font-size: 14px;
}

/* === FAVICON GRID - CRITICAL: NO OVERLAPPING === */
.preview-result {
    width: 100%;
}

.favicon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    width: 100%;
}

.favicon-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: transform 0.2s ease;
}

.favicon-preview:hover {
    transform: translateY(-2px);
}

.favicon-image {
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--bg-primary);
    display: block;
}

.favicon-size {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.favicon-dimensions {
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: center;
}

/* === FAVICON INFO === */
.favicon-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.favicon-info strong {
    color: var(--text-primary);
}

/* === DOWNLOAD OPTIONS === */
.download-options {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.download-options .button-download,
.download-options .button-secondary {
    flex: 1;
}

/* === PRO FEATURES ROW === */
.pro-features {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.pro-features .button-secondary {
    flex: 1;
}

/* === ERROR STATES === */
.input-error {
    color: var(--color-error, #ef4444);
    font-size: 13px;
    margin-top: var(--space-xs);
}

.input-group.has-error .text-input,
.input-group.has-error .emoji-input,
.input-group.has-error .file-upload-zone {
    border-color: var(--color-error, #ef4444);
}

/* === LOADING STATES === */
.button-primary.is-loading .button-text {
    visibility: hidden;
}

.button-primary.is-loading .button-spinner {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.button-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.button-primary {
    position: relative;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .pro-features {
        flex-direction: column;
    }
    
    .download-options {
        flex-direction: column;
    }
    
    .input-mode-tabs {
        flex-direction: column;
    }
    
    .mode-tab {
        text-align: center;
    }
    
    .color-input-group {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
    
    .color-picker {
        width: 40px;
        height: 40px;
    }
    
    .favicon-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: var(--space-md);
    }
    
    .preview-container {
        min-height: 200px;
    }
    
    .emoji-input {
        font-size: 24px;
        height: 60px;
    }
}