@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.settings-subheading {
    margin: 1rem 0 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-field input {
    width: auto;
}

.gallery-settings-block {
    margin-top: 0.25rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
}

.gallery-settings-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gallery-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 1rem;
    align-items: end;
}

.gallery-settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.gallery-settings-field label {
    font-weight: 600;
    color: var(--text-primary);
}

.gallery-settings-field input[type="number"] {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.gallery-settings-field.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    grid-column: 1 / -1;
}

.gallery-settings-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
}

@media (max-width: 960px) {
    .gallery-settings-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.gallery-settings-field .field-inline {
    font-weight: 500;
    color: var(--text-secondary);
}

.gallery-settings-field .field-hint {
    margin: 0;
}

.gallery-settings-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.gallery-card > .gallery-actions {
    order: 1;
}

.gallery-card > .gallery-settings-block {
    order: 2;
}

.gallery-settings-status {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
:root {
    --bg-primary: #f7f7f4;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f6;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --success: #16a34a;
    --error: #ef4444;
    --shadow: rgba(15, 23, 42, 0.12);
    --glow: rgba(59, 130, 246, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.12), transparent 32%),
        radial-gradient(circle at 80% 0%, rgba(253, 186, 116, 0.18), transparent 30%),
        var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.admin-container {
    min-height: 100vh;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2.5rem;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px var(--shadow);
}

.admin-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: block;
    color: var(--accent);
    filter: drop-shadow(0 12px 24px var(--shadow));
}

.login-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    background: linear-gradient(120deg, #111827, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-card input {
    padding: 0.85rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.login-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--glow);
}

.login-help {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.login-help small {
    font-size: 0.85rem;
    line-height: 1.5;
    display: block;
}

.error-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 8px;
    color: var(--error);
    font-size: 0.9rem;
}

/* Admin Dashboard */
.admin-dashboard {
    min-height: 100vh;
}

.admin-header {
    background: transparent;
    border-bottom: none;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-logo-small {
    width: 40px;
    height: 40px;
    color: var(--accent);
    filter: drop-shadow(0 10px 20px var(--shadow));
}

.admin-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(120deg, #111827, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.product-tag {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.content-section {
    margin-top: 1rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.editor-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 18px 38px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 0.55rem 0.9rem;
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.editor-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 120px;
}

.wysiwyg {
    min-height: 220px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    line-height: 1.6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.wysiwyg:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
    background: #fff;
}

.code-editor {
    min-height: 220px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0b1221;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    line-height: 1.5;
    resize: vertical;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.code-editor:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    margin-bottom: 2rem;
    box-shadow: none;
}

.admin-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.section-actions {
    margin-bottom: 1.5rem;
}

.settings-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 16px 32px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem 1.25rem;
}

.settings-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.defaults-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.defaults-grid .checkbox-field {
    grid-column: 1 / -1;
    justify-content: flex-start;
}

@media (max-width: 960px) {
    .settings-grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
    .settings-grid-2 {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
    .defaults-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

.settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.settings-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.settings-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.field-inline {
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.5rem;
    font-size: 0.95rem;
}

/* Buttons */
button, .btn-primary, .btn-secondary {
    padding: 0.85rem 1.6rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #60a5fa);
    color: white;
    box-shadow: 0 16px 30px var(--glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #60a5fa);
    transform: translateY(-2px);
    box-shadow: 0 18px 38px var(--glow);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: 0 10px 26px var(--shadow);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.btn-danger:hover {
    background: var(--error);
    color: white;
}

/* Galleries List */
.galleries-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.gallery-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    transition: all 0.25s ease;
    box-shadow: 0 16px 38px var(--shadow);
}

.gallery-card.is-open {
    grid-column: 1 / -1;
}

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

.gallery-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-left: auto;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.gallery-toggle-btn {
    padding: 0.45rem 0.75rem;
}

.gallery-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: 0 20px 45px var(--shadow);
}

.gallery-info {
    flex: 1;
}

.gallery-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.gallery-name-text {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.gallery-name-text:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.gallery-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.gallery-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gallery-actions button {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    border-radius: 10px;
}

.gallery-view-btn {
    padding: 0.85rem 1.4rem;
    font-size: 1rem;
    font-weight: 700;
    min-width: 170px;
}

.password-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.badge-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-left: 0.5rem;
}

.badge-row .password-badge,
.badge-row .no-password-badge {
    margin-left: 0;
}

.no-password-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(113, 113, 122, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 18px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px var(--shadow);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-content input {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-main {
        padding: 1rem;
    }

    .admin-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .gallery-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .gallery-summary {
        margin: 0;
        white-space: normal;
    }

    .gallery-header-row {
        cursor: default;
    }

    .gallery-actions {
        width: 100%;
        flex-direction: column;
    }

    .gallery-actions button {
        width: 100%;
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }
}

