/* Topbar Settings Button in Header */
.topbar-settings-btn {
    position: relative;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* color managed by dynamic config in header.php */
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-settings-btn:hover {
    border-color: #814ac8;
    background: rgba(129, 74, 200, 0.1);
}

.topbar-settings-btn svg {
    width: 20px;
    height: 20px;
}

/* Topbar Settings Dialog */
.topbar-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.topbar-dialog.active {
    display: flex;
    opacity: 1;
}

.topbar-dialog-content {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    width: 90vw;
    height: 90vh;
    position: relative;
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Dialog Header */
.topbar-dialog-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative;
}

.topbar-close {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.topbar-close:hover {
    transform: translateY(-50%) rotate(90deg);
}

.topbar-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    text-align: left;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Tabs */
.topbar-tabs {
    flex-shrink: 0;
    padding: 0 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.topbar-tabs .tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
}

.topbar-tabs .tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.topbar-tabs .tab-btn.active {
    color: #814ac8;
    border-bottom-color: #814ac8;
}

/* Dialog Body */
.topbar-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 74, 200, 0.5) rgba(255, 255, 255, 0.1);
}

.topbar-dialog-body::-webkit-scrollbar {
    width: 6px;
}

.topbar-dialog-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.topbar-dialog-body::-webkit-scrollbar-thumb {
    background: rgba(129, 74, 200, 0.5);
    border-radius: 0;
}

.topbar-dialog-body::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 74, 200, 0.8);
}

/* Dialog Footer */
.topbar-dialog-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: #000;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topbar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

/* Form */
.topbar-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topbar-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 25px;
}

.topbar-form .form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    align-items: start;
}

.topbar-form .form-row.cols-1 {
    grid-template-columns: 1fr;
}

.topbar-form .form-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.topbar-form .form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

.topbar-form .form-row .form-group {
    margin-bottom: 0;
}

.topbar-form .form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 400;
}

.topbar-form .form-group small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.topbar-form .form-group input[type="text"],
.topbar-form .form-group input[type="url"],
.topbar-form .form-group input[type="number"],
.topbar-form .form-group select,
.topbar-form .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    transition: all 0.3s ease;
}

.topbar-form .form-group input:focus,
.topbar-form .form-group select:focus,
.topbar-form .form-group textarea:focus {
    outline: none;
    border-color: #814ac8;
    background: rgba(255, 255, 255, 0.05);
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.color-picker-input {
    width: 50px;
    max-width: 50px;
    min-width: 50px;
    height: 45px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    cursor: pointer;
}

.color-text-input {
    flex: 1;
    font-family: monospace;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Errors and Success */
.topbar-error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 0;
    padding: 10px 12px;
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
}

.topbar-success {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 0;
    padding: 10px 12px;
    color: #6bff6b;
    font-size: 13px;
    text-align: center;
}

/* Buttons */
.btn-topbar {
    padding: 8px 16px;
    background: #814ac8;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    white-space: nowrap;
}

.btn-topbar:hover {
    background: #9b66d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(129, 74, 200, 0.3);
}

.btn-topbar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-topbar-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    white-space: nowrap;
}

.btn-topbar-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Responsive */
@media (max-width: 1200px) {
    .form-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .topbar-dialog-content {
        width: 95vw;
        height: 95vh;
    }

    .topbar-dialog-header {
        padding: 15px 20px;
    }

    .topbar-close {
        right: 15px;
    }

    .topbar-title {
        font-size: 15px;
    }

    .topbar-tabs {
        padding: 0 20px;
    }

    .topbar-dialog-body {
        padding: 20px;
    }

    .topbar-dialog-footer {
        padding: 15px 20px;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-topbar,
    .btn-topbar-secondary {
        width: 100%;
    }

    .color-picker-input {
        height: 40px;
    }
}

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

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Layout Options */
.layout-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.layout-option {
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.layout-option:hover {
    border-color: rgba(129, 74, 200, 0.5);
    background: rgba(129, 74, 200, 0.05);
}

.layout-option input[type="radio"] {
    display: none;
}

.layout-option:has(input[type="radio"]:checked) {
    border-color: #814ac8;
    background: rgba(129, 74, 200, 0.1);
}

.layout-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.preview-bar {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

.preview-bar.preview-attached {
    justify-content: flex-start;
    gap: 10px;
}

.preview-bar.preview-centered {
    justify-content: center;
    gap: 20px;
}

.layout-preview span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #814ac8;
    cursor: pointer;
}

/* Range Input */
input[type="range"] {
    width: 100%;
    accent-color: #814ac8;
}

output {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(129, 74, 200, 0.1);
    color: #814ac8;
    font-weight: 500;
    margin-top: 5px;
}

/* Header Preview */
.header-preview-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.header-preview-container {
    position: sticky;
    top: 0;
}

.header-preview-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-preview-mini {
    width: 100%;
    height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.header-preview-mini-bg {
    width: 100%;
    height: 100%;
    background: url('../img/home.jpeg') center center / cover no-repeat;
    position: relative;
}

.header-preview-mini-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.header-preview-mini-logo {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.header-preview-mini-menu {
    display: flex;
    gap: 15px;
}

.header-preview-mini-menu span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 900px) {
    .header-preview-wrapper {
        grid-template-columns: 1fr;
    }

    .header-preview-container {
        position: static;
    }
}
