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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Raleway', sans-serif;
    background-color: #f4f7f6;
    overflow-y: auto;
}

/* === Page Layout === */
.manager-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 40px 24px;
}

/* === Header === */
.manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 16px 24px;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #2596be;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.manager-header h1 {
    font-size: 1.4em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.manager-header .back-link {
    padding: 8px 18px;
    background: #6c757d;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.2s;
}

.manager-header .back-link:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* === Dev Banner === */
.dev-banner {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
    padding: 6px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* === Status Message === */
#status-message {
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    display: none;
    text-align: center;
    font-size: 0.95em;
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    min-width: 320px;
    max-width: 600px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    animation: statusSlideIn 0.3s ease;
}

@keyframes statusSlideIn {
    from { top: -60px; opacity: 0; }
    to { top: 24px; opacity: 1; }
}

#status-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
#status-message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
#status-message.warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
#status-message.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* === Section panels === */
.section-panel {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.section-panel h2 {
    font-size: 1.2em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 6px 0;
    border-bottom: 2px solid #2596be;
    padding-bottom: 10px;
}

.section-panel .section-desc {
    font-size: 0.9em;
    color: #7f8c8d;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* === Product Selector === */
.product-selector-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.product-selector-row label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.product-selector-row select {
    padding: 10px 14px;
    font-size: 1em;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    background: #fff;
    color: #2c3e50;
    cursor: pointer;
    min-width: 200px;
}

.product-selector-row select:focus {
    outline: none;
    border-color: #2596be;
}

/* === Existing Pages List === */
.pages-list {
    margin-bottom: 20px;
}

.pages-list table {
    width: 100%;
    border-collapse: collapse;
}

.pages-list th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #dfe6e9;
    font-size: 0.85em;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pages-list td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95em;
    color: #333;
}

.pages-list tr:hover td {
    background: #f8f9fa;
}

.pages-list .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.pages-list .badge-default {
    background: #e9ecef;
    color: #495057;
}

.pages-list .badge-custom {
    background: #d1ecf1;
    color: #0c5460;
}

.btn-delete-page {
    padding: 4px 12px;
    font-size: 0.8em;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete-page:hover {
    background: #c82333;
}

.btn-delete-page:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}

/* === Create Page Form === */
.create-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.create-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.create-form label {
    font-weight: 600;
    font-size: 0.85em;
    color: #2c3e50;
}

.create-form input,
.create-form select {
    padding: 10px 14px;
    font-size: 0.95em;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    background: #fff;
    color: #2c3e50;
}

.create-form input:focus,
.create-form select:focus {
    outline: none;
    border-color: #2596be;
}

.create-form .form-hint {
    font-size: 0.8em;
    color: #95a5a6;
    font-style: italic;
}

.btn-create-page {
    padding: 10px 24px;
    font-size: 1em;
    font-weight: 600;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn-create-page:hover {
    background: #219a52;
}

.btn-create-page:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}

/* === Home Page Cards Editor === */
.cards-editor {
    margin-top: 16px;
}

.card-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-section-header h3 {
    font-size: 1em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.btn-add-section {
    padding: 6px 14px;
    font-size: 0.85em;
    background: #2596be;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-section:hover {
    background: #1e7fa0;
}

.card-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.card-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.card-section-title input {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.95em;
    font-weight: 600;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    margin-right: 8px;
}

.card-section-title input:focus {
    outline: none;
    border-color: #2596be;
}

.card-section-title .section-lang-label {
    font-size: 0.8em;
    color: #95a5a6;
    margin-right: 8px;
}

.card-section-title .btn-remove-section {
    padding: 4px 10px;
    font-size: 0.8em;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.card-list {
    padding: 12px;
    min-height: 40px;
}

.card-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fff;
    transition: background 0.15s;
}

.card-item:hover {
    background: #f8f9fa;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-row-sub {
    padding-left: 38px;
}

.card-item .drag-handle {
    cursor: grab;
    color: #95a5a6;
    text-align: center;
    font-size: 1.2em;
    user-select: none;
    width: 24px;
    flex-shrink: 0;
}

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

.card-field-label {
    font-size: 0.78em;
    font-weight: 600;
    color: #7f8c8d;
    white-space: nowrap;
    min-width: 52px;
}

.card-item input {
    padding: 5px 8px;
    font-size: 0.85em;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
}

.card-item input:focus {
    outline: none;
    border-color: #2596be;
}

.card-input-icon {
    width: 80px;
    flex-shrink: 0;
}

.card-input-title {
    flex: 1;
    min-width: 0;
}

.card-input-link {
    flex: 1;
    min-width: 0;
}

.card-input-desc {
    flex: 1;
    min-width: 0;
}

.card-item .btn-remove-card {
    padding: 4px 8px;
    font-size: 0.75em;
    background: #e9ecef;
    color: #dc3545;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.card-item .btn-remove-card:hover {
    background: #f5c6cb;
}

.btn-add-card {
    padding: 6px 14px;
    font-size: 0.85em;
    background: #e9ecef;
    color: #2c3e50;
    border: 1px dashed #ced4da;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
    transition: background 0.2s;
}

.btn-add-card:hover {
    background: #dee2e6;
}

/* === Save Section === */
.save-section {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.save-section .name-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-section label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.save-section input[type="text"] {
    padding: 10px 14px;
    font-size: 0.95em;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    width: 200px;
}

.save-section input[type="text"]:focus {
    outline: none;
    border-color: #2596be;
}

.btn-save {
    padding: 10px 28px;
    font-size: 1em;
    font-weight: 600;
    background: #2596be;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: #1e7fa0;
}

.btn-save:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}

/* === Confirm Modal === */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.confirm-box {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.confirm-box h3 {
    margin: 0 0 12px 0;
    font-size: 1.2em;
    color: #2c3e50;
}

.confirm-box p {
    color: #555;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.confirm-box .confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-box .confirm-actions button {
    padding: 10px 24px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-confirm-yes {
    background: #dc3545;
    color: white;
}

.btn-confirm-yes:hover {
    background: #c82333;
}

.btn-confirm-no {
    background: #e9ecef;
    color: #2c3e50;
}

.btn-confirm-no:hover {
    background: #dee2e6;
}

/* === Dragging state === */
.card-item.dragging {
    opacity: 0.5;
    background: #e3f2fd;
}

/* === Change tracking === */
.card-item input.changed,
.card-section-title input.changed {
    color: #2596be;
    border-color: #2596be;
    font-weight: 600;
}

.card-item-new {
    border-left: 3px solid #2596be;
    background: #f0f9ff;
}

/* === Help Tooltips === */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dfe6e9;
    color: #636e72;
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.help-tip:hover {
    background: #2596be;
    color: #fff;
}

.help-tip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    width: 240px;
    line-height: 1.5;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
}

.help-tip:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    z-index: 10001;
    pointer-events: none;
}
