/* Main Layout Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #0e2c5e;
    color: white;
    border-radius: 8px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Editor Section */
.editor-section {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}


.legal-notice {
    margin-top: auto;
    padding: 15px 25px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85em;
    color: #555;
    flex-shrink: 0;
}

.legal-notice p {
    margin: 0;
    line-height: 1.5;
}

.legal-notice a {
    color: #0e2c5e;
    text-decoration: underline;
}

.legal-notice a:hover {
    text-decoration: none;
    color: #1a3f73;
}

.editor-section h2 {
    margin-bottom: 20px;
    color: #0e2c5e;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0e2c5e;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

#export-btn {
    background-color: #0e2c5e;
    color: white;
}

#export-btn:hover {
    background-color: #1a3f73;
}

#reset-btn {
    background-color: #6c757d;
    color: white;
}

#reset-btn:hover {
    background-color: #5a6268;
}

#save-btn, #load-btn {
    background-color: #28a745;
    color: white;
}

#save-btn:hover, #load-btn:hover {
    background-color: #218838;
}

#clear-image {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

#clear-image:hover {
    background-color: #c82333;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85em;
    line-height: 1.4;
}

/* Color Controls */
.color-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.color-control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.color-control-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.color-control-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    padding: 2px;
}

.color-control-group input[type="color"]:hover {
    border-color: #4CAF50;
}

/* Action Cost Toggle */
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.action-cost-selector {
    margin-top: 10px;
    padding-left: 20px;
}

/* Type/Level Container */
.type-level-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
    padding-left: 20px;
}

/* Type/Level Custom Inputs */
.type-level-container .form-group input {
    margin-top: 5px;
}


/* Preview Section */
.preview-section {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.preview-section h2 {
    margin-bottom: 20px;
    color: #0e2c5e;
    font-size: 1.8em;
}

.preview-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 600px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
    transform: scale(0.8);
    transform-origin: top center;
}

/* Tabs */
.tabs-container {
    margin-top: 20px;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 0;
    overflow-x: auto;
}

.tab-button {
    background-color: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-button:hover {
    color: #0e2c5e;
    background-color: rgba(14, 44, 94, 0.1);
}

.tab-button.active {
    color: #0e2c5e;
    border-bottom-color: #0e2c5e;
    background-color: rgba(14, 44, 94, 0.1);
    font-weight: 600;
}

.tabs-content {
    padding-top: 20px;
}

.tab-pane {
    display: none !important;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .preview-container {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .editor-section,
    .preview-section {
        padding: 15px;
    }

    .tab-button {
        padding: 10px 15px;
        font-size: 0.85em;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }
}