/* === POPXL Digital Admin CSS === */

:root {
    --primary: #1d3e8c;
    --accent: #3eb3bf;
    --dark: #1c1931;
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 10px;
}

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

body {
    font-family: 'Quicksand', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* === Header === */
.admin-header {
    background: var(--dark);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.badge {
    background: var(--accent);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.back-link {
    color: var(--accent);
    font-size: 0.85rem;
    text-decoration: none;
}

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

/* === Buttons === */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #162f6b;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    background: var(--bg);
    border: 1px dashed var(--border);
    color: var(--text-light);
    border-radius: var(--radius);
}

.btn-small:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.btn-icon:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* === Container === */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* === Section blocks === */
.section-block {
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.section-block:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
}

.section-type-badge {
    font-size: 0.7rem;
    color: var(--text-light);
    background: var(--card);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.drag-handle {
    cursor: grab;
    color: var(--text-light);
    font-size: 1.2rem;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.section-body {
    padding: 1.25rem;
}

/* === Forms === */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s ease;
    background: var(--card);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 62, 140, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* === Items list (services, FAQ, etc.) === */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.item-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.item-header strong {
    font-size: 0.9rem;
}

.item-block .form-grid {
    padding: 1rem;
}

/* === File upload === */
.file-upload {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-upload input[type="file"] {
    font-size: 0.85rem;
}

.current-file {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* === Gallery === */
.gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.gallery-thumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.95rem;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.toast.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.toast.success {
    background: var(--success);
    color: #fff;
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

/* === Options panel (details/summary) === */
.options-panel {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.options-panel summary {
    padding: 0.7rem 1rem;
    background: var(--bg);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}

.options-panel summary:hover {
    color: var(--primary);
}

.options-panel > .form-grid {
    padding: 1rem;
}

/* === Add section bar === */
.add-section-bar {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    align-items: center;
}

.add-section-bar select {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--card);
}

.btn-delete-section {
    font-size: 1.4rem;
    margin-left: auto;
}

/* === Dashboard === */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.client-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.client-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(29, 62, 140, 0.1);
    transform: translateY(-2px);
}

.client-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.client-theme {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
}

.client-slug {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.client-domain {
    display: block;
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 0.25rem;
}

.client-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small-action {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    text-decoration: none;
    text-align: center;
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 16px 50px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.2rem;
}

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

/* === Settings panel === */
.settings-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-panel.hidden {
    display: none;
}

.settings-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Color input === */
.color-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input input[type="color"] {
    width: 40px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.color-input input[type="text"] {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* === Login === */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--card);
    padding: 3rem;
    border-radius: var(--radius);
    text-align: center;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-card h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-card p {
    color: var(--text-light);
}

/* === Sortable === */
.sortable-ghost {
    opacity: 0.3;
}

.sortable-chosen {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* === Responsive === */
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: 1;
    }

    .admin-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }
}
