/* ==========================================================================
   Screen Settings Modal - Layout & Navigation

   Uses reusable form components from components/forms.css
   ========================================================================== */

.settings-modal {
    max-width: 900px;
    width: 90vw;
    height: auto;
    max-height: 85vh;
    margin: auto;
    border-radius: var(--ip-radius-sm);
    overflow: hidden;
}

.settings-modal-layout {
    display: flex;
    height: 70vh;
    max-height: 70vh;
    background: var(--ip-bg-solid);
    border-radius: var(--ip-radius);
    overflow: hidden;
}

/* ==========================================================================
   Settings Sidebar Navigation
   ========================================================================== */

.settings-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--ip-bg-subtle);
    border-right: 1px solid var(--ip-border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--ip-border-subtle);
}

.settings-sidebar-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ip-text);
}

.settings-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.settings-nav-separator {
    height: 1px;
    background: var(--ip-border-subtle);
    margin: 12px 8px;
}

.settings-nav-header {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ip-text-muted);
    padding: 16px 12px 8px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--ip-radius-xs);
    color: var(--ip-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
}

.settings-nav-item:hover {
    background: var(--ip-bg-solid);
    color: var(--ip-text);
}

.settings-nav-item.active {
    background: var(--ip-primary);
    color: white;
}

.settings-nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   Settings Content Area
   ========================================================================== */

.settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.settings-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--ip-border);
    background: var(--ip-bg);
}

.settings-content-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ip-text);
}

.settings-content-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    max-width: 720px;
}

.settings-content-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--ip-border);
    background: var(--ip-bg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Settings-specific form overrides */
.settings-content-body .form-group {
    margin-bottom: 24px;
}

.settings-content-body label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ip-text);
    margin-bottom: 8px;
}

.settings-content-body label.form-switch {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-weight: 400;
}

.settings-content-body .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: var(--ip-radius-xs);
    background: #fff;
    color: var(--ip-text);
    font-size: 0.9375rem;
}

[data-theme="dark"] .settings-content-body .form-control {
    border-color: #4b5563;
    background: #374151;
}

.settings-content-body .form-control:focus {
    outline: none;
    border-color: var(--ip-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.settings-content-body .form-control-color {
    width: 60px;
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

/* ==========================================================================
   Feature-specific Components (RSS, Radio, Weather, Footer, Logo)
   ========================================================================== */

/* RSS Items */
.rss-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.rss-item .form-control {
    flex: 1;
}

.rss-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Radio Player */
.radio-player-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

[data-theme="dark"] .radio-player-container {
    border-color: #374151;
}

.radio-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.radio-player-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--ip-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.radio-player-btn:hover {
    background: var(--ip-primary-hover);
}

.radio-player-btn:active {
    transform: scale(0.95);
}

.radio-player-btn i {
    width: 18px;
    height: 18px;
}

.radio-player-label {
    font-size: 0.875rem;
    color: var(--ip-text-secondary);
}

/* Weather Map */
.weather-map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

[data-theme="dark"] .weather-map {
    border-color: #374151;
}

.weather-map .leaflet-control-attribution {
    font-size: 10px;
}

/* Footer Type Grid */
.footer-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.footer-type-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--ip-bg-solid);
    border: 2px solid var(--ip-border);
    border-radius: var(--ip-radius-xs);
    cursor: pointer;
    transition: border-color 0.15s;
}

.footer-type-item:hover {
    border-color: var(--ip-primary-muted);
}

.footer-type-item.selected {
    border-color: var(--ip-primary);
}

.footer-type-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
    background: var(--ip-bg);
}

.footer-options {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--ip-border-subtle);
}

.sidebar-options {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ip-border-subtle);
}

/* Logo Preview */
.logo-preview-container {
    margin: 16px 0;
    padding: 16px;
    background: var(--ip-bg-solid);
    border-radius: var(--ip-radius-xs);
    text-align: center;
}

.logo-preview-container img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .settings-modal {
        width: 95vw;
        max-height: 90vh;
    }

    .settings-modal-layout {
        flex-direction: column;
        height: 80vh;
        max-height: 80vh;
    }

    .settings-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 35vh;
        border-right: none;
        border-bottom: 1px solid var(--ip-border);
    }

    .settings-content-body {
        padding: 20px;
    }

    .settings-content-header {
        padding: 16px 20px;
    }

    .settings-content-footer {
        padding: 12px 20px;
    }

    .footer-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
