/* Frontend Page Builder - Main Styles */

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

body.fpb-active {
    background: #f5f5f5;
}

.fpb-builder-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

/* ========== HEADER ========== */

.fpb-header {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fpb-header h1 {
    font-size: 24px;
    color: #000;
    margin: 0;
}

.fpb-header-actions {
    display: flex;
    gap: 10px;
}

/* ========== BUTTONS ========== */

.fpb-btn {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
}

.fpb-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.fpb-btn:active {
    transform: scale(0.98);
}

.fpb-btn-primary {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.fpb-btn-primary:hover {
    background: #004d99;
}

.fpb-btn-success {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.fpb-btn-success:hover {
    background: #004d99;
}

.fpb-btn-danger {
    background: #cd3333;
    color: #fff;
    border-color: #cd3333;
}

.fpb-btn-danger:hover {
    background: #a02626;
}

.fpb-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ========== LAYOUT ========== */

.fpb-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.fpb-sidebar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.fpb-sidebar:last-of-type {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.fpb-sidebar h2 {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #000;
}

.fpb-canvas {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    min-height: 600px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ========== SIDEBAR LEFT - CONTROLS ========== */

.fpb-control-group {
    margin-bottom: 20px;
}

.fpb-control-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.fpb-control-group select,
.fpb-control-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.fpb-control-group select:focus,
.fpb-control-group input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.fpb-add-row-btn {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.fpb-add-row-btn:hover {
    background: #333;
}

/* ========== ROWS AND COLUMNS ========== */

.fpb-row {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.fpb-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.fpb-columns {
    display: grid;
    gap: 15px;
    margin-bottom: 10px;
}

.fpb-columns.cols-1 {
    grid-template-columns: 1fr;
}

.fpb-columns.cols-2 {
    grid-template-columns: 50% 50%;
}

.fpb-columns.cols-3-equal {
    grid-template-columns: 1fr 1fr 1fr;
}

.fpb-columns.cols-3-wide-narrow {
    grid-template-columns: 2fr 1fr 1fr;
}

.fpb-columns.cols-3-narrow-wide {
    grid-template-columns: 1fr 1fr 2fr;
}

.fpb-column {
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 15px;
    min-height: 150px;
    transition: all 0.2s;
}

.fpb-column:hover {
    border-color: #999;
}

.fpb-column-tools {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.fpb-column-btn {
    padding: 6px 12px;
    font-size: 11px;
    border: 1px solid #ddd;
    background: #0066cc;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border-color: #0066cc;
    font-weight: 500;
}

.fpb-column-btn:hover {
    background: #004d99;
    border-color: #004d99;
}

/* ========== CONTENT BLOCKS ========== */

.fpb-content-block {
    background: #0066cc;
    border-left: 3px solid #0066cc;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
    color: #fff;
}

.fpb-content-block.text {
    border-left-color: #0066cc;
    background: #0066cc;
}

.fpb-content-block.image {
    border-left-color: #0066cc;
    background: #0066cc;
}

.fpb-content-block.button {
    border-left-color: #0066cc;
    background: #0066cc;
}

.fpb-content-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.fpb-content-block-header span {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.fpb-content-delete {
    padding: 3px 8px;
    font-size: 10px;
    background: #ff5555;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.fpb-content-delete:hover {
    background: #ff0000;
}

.fpb-content-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #fff;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    margin-bottom: 6px;
    background: #fff;
    color: #333;
}

.fpb-content-input:focus {
    outline: none;
    border-color: #004d99;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.fpb-content-input::placeholder {
    color: #999;
}

/* ========== SIDEBAR RIGHT - SEO ========== */

.fpb-seo-section {
    margin-bottom: 20px;
}

.fpb-seo-section h3 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #000;
}

.fpb-seo-results {
    background: #f0f0f0;
    border-radius: 6px;
    padding: 12px;
    max-height: 250px;
    overflow-y: auto;
    font-size: 12px;
}

.fpb-seo-item {
    background: #fff;
    border-left: 3px solid #ffcc00;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 3px;
    font-size: 11px;
}

.fpb-seo-item.good {
    border-left-color: #00aa00;
}

.fpb-seo-item.bad {
    border-left-color: #ff0000;
}

.fpb-seo-item strong {
    color: #000;
}

.fpb-seo-item span {
    color: #666;
}

/* ========== EXPORT SECTION ========== */

.fpb-export-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.fpb-export-section h3 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #000;
}

.fpb-export-code {
    background: #1e1e1e;
    color: #00ff00;
    padding: 12px;
    border-radius: 4px;
    font-size: 9px;
    font-family: 'Courier New', monospace;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #333;
    line-height: 1.3;
}

.fpb-copy-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: #cd3333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.fpb-copy-btn:hover {
    background: #a02626;
}

.fpb-copy-btn.copied {
    background: #00aa00;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1200px) {
    .fpb-layout {
        grid-template-columns: 1fr;
    }

    .fpb-sidebar {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .fpb-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .fpb-header-actions {
        width: 100%;
    }

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

    .fpb-columns.cols-2,
    .fpb-columns.cols-3 {
        grid-template-columns: 1fr;
    }

    .fpb-canvas {
        padding: 15px;
    }
}

/* ========== UTILITIES ========== */

.fpb-mt-10 { margin-top: 10px; }
.fpb-mb-10 { margin-bottom: 10px; }
.fpb-hidden { display: none; }

.fpb-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}

.fpb-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}

/* ========== WYSIWYG EDITOR ========== */

.fpb-wysiwyg-editor {
    background: #fff;
    border: 1px solid #0066cc;
    border-radius: 4px;
    overflow: hidden;
}

.fpb-editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: #e6f0ff;
    border-bottom: 1px solid #0066cc;
    flex-wrap: wrap;
}

.fpb-editor-btn {
    padding: 6px 10px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fpb-editor-btn:hover {
    background: #004d99;
}

.fpb-editor-btn:active {
    transform: scale(0.95);
}

.fpb-editor-content {
    padding: 12px;
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    word-break: break-word;
}

.fpb-editor-content:focus {
    outline: none;
}

.fpb-editor-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0;
}

.fpb-editor-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 6px 0;
}

.fpb-editor-content ul {
    margin: 6px 0 6px 20px;
}

/* ========== FOTO UPLOAD ========== */

.fpb-image-upload {
    position: relative;
}

.fpb-file-input {
    display: none;
}

.fpb-upload-label {
    display: block;
    padding: 16px;
    background: #e6f0ff;
    color: #0066cc;
    border: 2px dashed #0066cc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.fpb-upload-label:hover {
    background: #cce5ff;
    border-color: #004d99;
    color: #004d99;
}

.fpb-file-input:focus + .fpb-upload-label {
    border-color: #004d99;
    background: #cce5ff;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}
