/* Resetare și Stiluri de Bază */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px; 
    line-height: 1.5; 
    color: #3c4043; 
    background-color: #f4f4f5; 
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
}

.container {
    max-width: 1500px; 
    margin: 0 auto;
    background-color: transparent;
    padding-top: 30px;
    padding-bottom: 30px;
    box-shadow: none;
}

/* Header-ul Paginii - Stiluri actualizate pentru culori și layout */
.page-header {
    display: flex;        
    align-items: center;  
    padding-bottom: 16px;  
    margin-bottom: 24px;   
    border-bottom: 1px solid #dfe1e5; 
}

#tool-logo {
    max-width: 48px;       
    height: auto;
    margin-right: 12px;    
    flex-shrink: 0;        
}

.header-text-container {
    display: flex;
    flex-direction: column; 
}

.app-name { 
    font-size: 1.4em;      
    font-weight: 500;      
    color: #0D394B; /* Charcoal */
    margin: 0 0 3px 0;     
    line-height: 1.2;
}

.tagline {
    font-size: 0.8em;      
    color: #666666; /* Black 700 (gri din paleta ta anterioară) */
    margin: 0;
    line-height: 1.3;
    font-style: italic; 
}

h3 { /* Pentru "Preview" */
    color: #0D394B; /* Charcoal */
    font-size: 18px; 
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 16px;
}

/* Layout Editor și Preview */
.editor-preview-layout {
    display: flex;
    gap: 24px; 
    align-items: flex-start; 
}

.editor-pane {
    flex: 3; 
    display: flex;
    flex-direction: column;
    gap: 20px; 
}

.preview-pane {
    flex: 2; 
    padding: 20px; 
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 2px 5px rgba(0,0,0,0.08);
    align-self: flex-start; 
    position: sticky; 
    top: 20px;       
}

/* Stil Card pentru Fieldset-uri */
fieldset {
    background-color: #ffffff;
    border: 1px solid #dfe1e5; 
    border-radius: 8px; 
    padding: 20px 24px; 
    margin-bottom: 0; 
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302), 0 1px 3px 1px rgba(60,64,67,0.149);
}

/* Legendele Secțiunilor - Stiluri actualizate pentru culori */
legend {
    font-size: 0.95em; 
    font-weight: 500; 
    padding: 6px 12px; 
    margin-left: 0;  
    text-transform: uppercase; 
    letter-spacing: 0.6px;
    display: inline-flex; /* Changed to inline-flex for self-sizing background */
    align-items: center; 
    margin-bottom: 20px; 
    border-radius: 4px; 
    border: 1px solid transparent;
}

legend .material-icons-outlined { 
    font-size: 20px; 
    margin-right: 8px;
}

/* Culori specifice pentru fiecare legendă și iconița sa */
.legend-assets { 
    background-color: #f8e9d1; /* harvest_gold[900] (din paleta ta extinsă) */
    color: #815612;            /* harvest_gold[300] */
    border-color: #ebbd74;     /* harvest_gold[700] */
}
.legend-assets .material-icons-outlined { 
    color: #D78F1F; /* harvest_gold DEFAULT */
}

.legend-text { 
    background-color: #d1f1f8; /* pacific_cyan[900] */
    color: #146d7f;            /* pacific_cyan[300] */
    border-color: #75d6ea;     /* pacific_cyan[700] */
}
.legend-text .material-icons-outlined { 
    color: #21B6D3; /* pacific_cyan DEFAULT */
}

.legend-style { 
    background-color: #b7e2f2; /* charcoal[900] (light blue) */
    color: #0D394B;            /* charcoal DEFAULT */
    border-color: #6fc4e6;     /* charcoal[800] */
}
.legend-style .material-icons-outlined { 
    color: #D78F1F; /* Harvest Gold DEFAULT pentru contrast */
}


/* Grupuri de Formulare Generice (pentru Assets și Style) */
.form-group {
    margin-bottom: 16px; 
}
.form-group:last-child {
    margin-bottom: 0;
}

/* Etichete (pentru Assets și Style) */
.asset-control-group > label, /* Specific pentru Assets și Style */
.color-group > label {
    display: block; 
    font-size: 0.875em; 
    color: #5f6368; 
    margin-bottom: 6px; 
    font-weight: 400; 
}

/* Inputuri și Selectoare - Culoare de focus actualizată */
input[type="text"],
input[type="number"],
select {
    display: block; width: 100%; padding: 10px 0; font-size: 1em; 
    color: #3c4043; background-color: transparent; border: none;
    border-bottom: 1px solid #ccc; outline: none;
    transition: border-color 0.2s ease-in-out; box-sizing: border-box; border-radius: 0; 
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-bottom: 2px solid #21B6D3; /* Pacific Cyan DEFAULT */
}
select {
    padding-right: 24px; 
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%235F6368%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat; background-position: right 8px top 50%;
    background-size: .65em auto; -webkit-appearance: none; -moz-appearance: none; appearance: none;
}

/* Stiluri pentru secțiunea Text (layout nou și compact) */
.text-control-group { margin-bottom: 20px; }
.text-control-group:last-child { margin-bottom: 0; }
.text-input-row { margin-bottom: 10px; }
.text-input-row label { font-size: 0.9em; color: #0D394B; /* Charcoal */ font-weight: 500; margin-bottom: 6px; }
.text-input-row input[type="text"] { margin-bottom: 0; }

.font-controls-row { display: flex; gap: 12px; align-items: center; }
.font-controls-row select, .font-controls-row .font-size-input {
    margin-bottom: 0; padding-top: 9px; padding-bottom: 9px; flex-grow: 1; 
}
.font-controls-row .font-size-input {
    width: 65px; padding-left: 8px; text-align: right; flex-grow: 0; flex-shrink: 0; 
}
.font-controls-row span { font-size: 0.9em; color: #5f6368; margin-left: -8px; margin-right: 8px; }

/* Input Fișier (în secțiunea Assets) */
.asset-control-group input[type="file"] {
    font-size: 0.9em; color: #5f6368; padding: 8px 0; border: none;
    border-bottom: 1px solid #ccc; width: 100%; box-sizing: border-box; margin-bottom: 8px; 
}
.asset-control-group input[type="file"]::file-selector-button {
    font-weight: 500;
    color: #21B6D3; /* Pacific Cyan */
    border: 1px solid #21B6D3; /* Pacific Cyan */
    padding: 8px 12px; 
    border-radius: 4px; 
    background-color: #f8f9fa;
    cursor: pointer; margin-right: 12px; transition: background-color 0.2s, color 0.2s;
}
.asset-control-group input[type="file"]::file-selector-button:hover {
    background-color: #21B6D3; /* Pacific Cyan */
    color: white;
}

/* Input Culoare (general și specific) - Asigură forma circulară */
.font-controls-row input[type="color"], 
.form-group input[type="color"] {
    width: 30px; height: 30px; padding: 0; border: 1px solid #dadce0; 
    border-radius: 50%; vertical-align: middle; cursor: pointer; outline: none;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    box-sizing: border-box; flex-shrink: 0; 
}
.font-controls-row input[type="color"] { margin-left: auto; margin-bottom: 0; }
.form-group input[type="color"] { display: block; margin-top: 4px; }

input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 50%; }


/* Imagini Preview în Editor - Corectat pentru a nu se deforma */
#logo_preview, #product_preview {
    border: 1px solid #e0e0e0; padding: 0; background-color: #f8f9fa;
    border-radius: 4px; margin-top: 8px; display: block; object-fit: contain; 
}
#logo_preview { width: 80px; height: 40px; } 
#product_preview { width: 120px; height: 80px; }

/* Secțiunea Assets - Layout Orizontal */
.assets-row { display: flex; gap: 24px; align-items: flex-start; }
.asset-control-group { flex: 1; display: flex; flex-direction: column; }
/* Label-urile specifice pentru .asset-control-group sunt deja definite mai sus */

/* Secțiunea Style (Culori) - Layout Orizontal */
.style-colors-row { display: flex; gap: 24px; align-items: flex-start; }
.color-group { flex: 1; margin-bottom: 0; }
/* Label-urile specifice pentru .color-group sunt deja definite mai sus */


/* Rândul cu butoane de acțiune */
.actions-row { margin-top: 24px; text-align: left; }

/* Butoane - Culoare principală actualizată */
button {
    background-color: #21B6D3; /* Pacific Cyan DEFAULT */
    color: white;
    padding: 9px 20px; border: none; border-radius: 4px; cursor: pointer; 
    font-size: 0.9em; font-weight: 500; text-transform: uppercase; letter-spacing: 0.6px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302), 0 1px 3px 1px rgba(60,64,67,0.149);
    transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-right: 10px; margin-top: 0; 
}
button:last-child { margin-right: 0; }
button:hover {
    background-color: #1a92a9; /* Pacific Cyan 400 */
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.302), 0 2px 6px 2px rgba(60,64,67,0.149);
}
button:active {
    background-color: #146d7f; /* Pacific Cyan 300 */
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302), 0 1px 3px 1px rgba(60,64,67,0.149);
}
button:focus { outline: none; }

/* Butoane de redimensionare preview și "Preview All Sizes" */
.preview-sizes-controls {
    margin-bottom: 16px; padding-bottom: 10px; text-align: center; 
}
.preview-sizes-controls p {
    margin-top: 0; margin-bottom: 10px; font-size: 0.9em;   
    color: #5f6368; font-weight: 500;   
}
.preview-sizes-controls .size-btn { 
    font-size: 0.85em; padding: 5px 9px; background-color: #f1f3f4; 
    color: #3c4043; text-transform: none; letter-spacing: normal;
    box-shadow: none; font-weight: 400; border: 1px solid #dadce0; 
    border-radius: 4px; margin-right: 8px; margin-bottom: 8px; 
    cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
.preview-sizes-controls .size-btn:hover {
    background-color: #e8eaed; border-color: #c6c9ce;
}
.preview-sizes-controls hr {
    margin-top: 10px; margin-bottom: 14px; border: 0; border-top: 1px solid #e0e0e0; 
}
.preview-sizes-controls button#preview_all_sizes_button { 
    margin-top: 0; display: inline-flex; align-items: center;
    padding: 8px 16px; font-size: 0.85em;
    background-color: #0D394B; /* Charcoal pentru butonul "Preview All" */
}
.preview-sizes-controls button#preview_all_sizes_button:hover {
    background-color: #0a2d3b; /* Charcoal 400 */
}
.preview-sizes-controls button#preview_all_sizes_button:active {
    background-color: #08222c; /* Charcoal 300 */
}
.preview-sizes-controls button#preview_all_sizes_button .material-icons-outlined {
    margin-right: 6px; font-size: 1.1em;  
}

/* Iframe Preview */
#banner_preview_iframe { 
    border: 1px solid #dadce0; border-radius: 4px; 
    transform-origin: top left; display: block; 
    margin-left: auto; margin-right: auto;
}

/* Ajustări Responsive pentru Interfață */
@media (max-width: 1000px) { 
    .editor-preview-layout { flex-direction: column; gap: 20px; }
    .editor-pane, .preview-pane { flex: none; }
    .assets-row, .style-colors-row { flex-direction: column; gap: 16px; }
    .asset-control-group, .color-group { width: 100%; }
    .preview-pane { margin-top: 20px; align-self: stretch; position: static; }
    .page-header { flex-direction: column; text-align: center; } 
    #tool-logo { margin-right: 0; margin-bottom: 8px; }
    .app-name, .tagline { text-align: center;}
}

@media (max-width: 768px) { 
    .font-controls-row { flex-wrap: wrap; }
    .font-controls-row select, .font-controls-row .font-size-input {
        flex-basis: calc(50% - 6px); 
    }
    .font-controls-row input[type="color"] { margin-left: 0; margin-top: 8px; }
    .preview-sizes-controls .size-btn { display: block; width: calc(100% - 16px); margin-left:auto; margin-right:auto; }
    .preview-sizes-controls #preview_all_sizes_button { width: calc(100% - 16px); margin-left:auto; margin-right:auto; justify-content: center;}
}