﻿/* ===========================================
   Draft Settings Page Styles
   =========================================== */

/* Hero Banner - Full Width */
.hero-banner {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    position: relative;
}

    .hero-banner img {
        width: 100%;
        height: auto;
        display: block;
    }

/* Header Row */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Actions Container */
.draft-settings-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

    .btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.3);
    }

.btn-primary {
    background-color: #16a34a;
    color: #ffffff;
}

    .btn-primary:hover {
        background-color: #15803d;
    }

    .btn-primary:active {
        transform: translateY(1px);
    }

    .btn-primary:disabled {
        background-color: #9ca3af;
        cursor: not-allowed;
        transform: none;
    }

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

    .btn-secondary:hover {
        background-color: #e5e7eb;
        border-color: #9ca3af;
    }

    .btn-secondary:active {
        transform: translateY(1px);
    }

/* ===========================================
   Main Content Area
   =========================================== */

.draft-settings-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem;
}

/* Loading State */
.settings-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    color: #6b7280;
}

    .settings-loading .loading-spinner {
        width: 40px;
        height: 40px;
        border: 3px solid #e5e7eb;
        border-top-color: #16a34a;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.settings-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Locked Notice */
.settings-locked-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

    .settings-locked-notice svg {
        flex-shrink: 0;
    }

/* ===========================================
   Settings Cards (with gap between cards)
   =========================================== */

.settings-main .settings-card + .settings-card {
    margin-top: 1.5rem;
}

.settings-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.settings-card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.settings-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

    .settings-card-title svg {
        color: #16a34a;
    }

.settings-card-description {
    color: #6b7280;
    font-size: 0.9375rem;
    margin: 0;
}

.settings-card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-card-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ===========================================
   Form Elements
   =========================================== */

.settings-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9375rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.settings-label-hint {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.875rem;
}

.settings-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-input {
    width: 120px;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    .settings-input:focus {
        outline: none;
        border-color: #16a34a;
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    }

    .settings-input:disabled {
        background-color: #f3f4f6;
        color: #9ca3af;
        cursor: not-allowed;
    }

.settings-input-range {
    color: #9ca3af;
    font-size: 0.875rem;
}

.settings-help-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
    line-height: 1.5;
}

/* ===========================================
   Toggle Switch
   =========================================== */

.settings-toggle-group {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.settings-toggle-info {
    flex: 1;
}

.settings-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 2px;
}

    .settings-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

.toggle-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    border-radius: 26px;
    transition: background-color 0.3s ease;
}

    .toggle-switch::before {
        content: '';
        position: absolute;
        height: 20px;
        width: 20px;
        left: 3px;
        bottom: 3px;
        background-color: #ffffff;
        border-radius: 50%;
        transition: transform 0.3s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }

.settings-toggle input:checked + .toggle-switch {
    background-color: #16a34a;
}

    .settings-toggle input:checked + .toggle-switch::before {
        transform: translateX(22px);
    }

.settings-toggle input:disabled + .toggle-switch {
    background-color: #e5e7eb;
    cursor: not-allowed;
}

    .settings-toggle input:disabled + .toggle-switch::before {
        box-shadow: none;
    }

.settings-toggle input:focus-visible + .toggle-switch {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.3);
}

/* ===========================================
   Shared Save Footer
   =========================================== */

.settings-save-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ===========================================
   Save Button States
   =========================================== */

.btn-save {
    min-width: 140px;
}

    .btn-save.loading {
        position: relative;
        color: transparent;
        pointer-events: none;
    }

        .btn-save.loading::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 18px;
            height: 18px;
            margin: -9px 0 0 -9px;
            border: 2px solid #ffffff;
            border-top-color: transparent;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }

/* Save Status Messages */
.save-status {
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

    .save-status.success {
        color: #16a34a;
    }

    .save-status.error {
        color: #dc2626;
    }

/* ===========================================
   Responsive Design
   =========================================== */

@media (max-width: 768px) {
    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .draft-settings-actions {
        width: 100%;
    }

        .draft-settings-actions .btn {
            flex: 1;
            min-width: 0;
        }
}

@media (max-width: 640px) {
    .draft-settings-content {
        padding: 0 0.5rem 1.5rem 0.5rem;
    }

    .settings-card-header,
    .settings-card-body {
        padding: 1.25rem;
    }

    .settings-input-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .settings-input {
        width: 100%;
        max-width: 200px;
    }

    .settings-save-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-save {
        width: 100%;
    }

    .save-status {
        text-align: center;
    }

    .settings-toggle-group {
        gap: 0.75rem;
    }
}
