/* Brief Export Page Styles */

.brief-error {
    background: #FC554F;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

/* Export Buttons */
.brief-export-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.export-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.export-btn:hover {
    border-color: #6767D9;
    background: #f8f9ff;
}

.export-btn i {
    font-size: 16px;
}

/* Graphic Charter */
.brief-graphic-charter {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.brief-graphic-charter h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.charter-field {
    display: flex;
    align-items: center;
    gap: 0px;
    margin: 15px 0;
}

#display-name {width: 100%;}

.charter-colors {
    display: flex;
    gap: 30px;
    margin: 15px 0;
}

.charter-colors .charter-field {
    margin: 0;
}

.charter-field input[type="color"] {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
}

.charter-field input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.save-btn {
    background: #000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin: 15px auto 0 auto;
    display: block;
}

.save-btn:hover {
    background: #444;
}

/* Logo Upload */
.logo-field {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo-upload-label {
    display: flex;
    cursor: pointer;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px;
    align-items: center;
    justify-content: center;
    width: 200px;
    margin: 0 auto 10px auto;
}

.logo-upload-label:hover {
    border-color: #6767D9;
    background: #f8f9ff;
}

.logo-preview {
    max-width: 180px;
    max-height: 100px;
    object-fit: contain;
    border-radius: 4px;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #666;
}

.logo-placeholder i {
    font-size: 24px;
    color: #6767D9;
}

.logo-placeholder span {
    font-size: 14px;
}

.remove-logo-btn {
    background: #FC554F;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s ease;
    margin: 0 auto;
}

.remove-logo-btn:hover {
    background: #e74c3c;
}

/* Footer Info */
.footer-info-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

#footer-info {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

#footer-info:focus {
    outline: none;
    border-color: #6767D9;
    box-shadow: 0 0 0 2px rgba(103, 103, 217, 0.1);
}

.footer-info-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Query Display */
.brief-query-section {
    margin: 30px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.query-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.query-title {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}



.query-text {
    font-size: 18px;
    font-weight: 500;
    color: #6767D9;
    text-align: center;
    padding: 15px;
    padding-bottom: 15px !important;
    background: #f8f9ff;
    border-radius: 5px;
}

/* Metrics Display */
.brief-metrics {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.metric-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    flex: 1;
}

.metric-title {
    color: #6767D9;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.metric-value.editable-metric {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.metric-value.editable-metric:hover {
    background: #f8f9ff;
    color: #6767D9;
    padding-top: 5px;
    padding-bottom: 5px;
}

.metric-value.editable-metric[contenteditable="true"] {
    outline: none;
    background: white;
    color: #333;
}

/* Froala Sections */
.brief-froala-section {
    margin: 30px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    padding-right: 20px;
    padding-left: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.section-header h3 {
    margin: 0;
    color: #000;
    font-size: 18px;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    margin-right: 20px !important;
}

.visibility-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.visibility-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #24C789;
}

.visibility-toggle span {
    color: #666;
    font-size: 14px;
}

.froala-editor {
    min-height: 200px;
    border: none;
}

/* Réduction de la taille des titres dans le menu déroulant Froala */
.fr-dropdown-list h1[style*="font-size: 2em"],
.fr-dropdown-list h2[style*="font-size: 1.5em"],
.fr-dropdown-list h3[style*="font-size: 1.17em"],
.fr-dropdown-list h4[style*="font-size: 15px"] {
    font-size: 15px !important;
}

/* Alternative plus spécifique pour tous les titres */
.fr-dropdown-list li h1 a,
.fr-dropdown-list li h2 a,
.fr-dropdown-list li h3 a,
.fr-dropdown-list li h4 a {
    font-size: 15px !important;
    line-height: 1.4 !important;
    margin-top: 3px !important;
    margin-bottom: 3px !important;
    font-weight: 500 !important;
}

/* Groupe titre et dropdown */
.section-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.brief-keywords-section .section-title-group {
    gap: 0;
}

.brief-keywords-section .section-title-group h3 {
    margin: 0;
}

/* Dropdown pour le type de plan */
.plan-type-dropdown {
    border: 2px solid transparent;
    background: 
        url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") no-repeat right 8px center,
        linear-gradient(white, white) padding-box,
        linear-gradient(90deg, #C488F8, #8585F7) border-box;
    background-size: 16px, auto, auto;
    border-radius: 6px;
    padding: 8px 30px 8px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 150px;
    appearance: none;
}

.plan-type-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(196, 136, 248, 0.1);
}

.plan-type-dropdown:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* Dropdown pour le nombre de sections */
.plan-sections-dropdown {
    border: 2px solid transparent;
    background: 
        url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") no-repeat right 8px center,
        linear-gradient(white, white) padding-box,
        linear-gradient(90deg, #8585F7, #C488F8) border-box;
    background-size: 16px, auto, auto;
    border-radius: 6px;
    padding: 8px 30px 8px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 120px;
    appearance: none;
    transition: all 0.2s ease;
}

.plan-sections-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(133, 133, 247, 0.1);
    transform: translateY(-1px);
}

.plan-sections-dropdown:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(133, 133, 247, 0.15);
}

.plan-sections-dropdown:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #f8f9fa;
    transform: none;
}

/* Amélioration du dropdown type de plan */
.plan-type-dropdown {
    transition: all 0.2s ease;
}

.plan-type-dropdown:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(196, 136, 248, 0.15);
}

/* Style pour les options */
.plan-type-dropdown option,
.plan-sections-dropdown option {
    padding: 8px 12px;
    background: white;
    color: #374151;
    font-weight: 500;
}

.plan-type-dropdown option:hover,
.plan-sections-dropdown option:hover {
    background: #f8f9ff;
}

/* Nom du projet */
.brief-project-name {
    margin: 20px 0;
}

.project-name-text {
    color: #000;
    font-size: 1.2em;
    font-weight: 500;
    position: relative;
    padding-left: 20px;
}

.project-name-text:before {
    content: '\f07b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #000;
    font-size: 12px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}


/* Keywords Sections */
.brief-keywords-section {
    margin: 30px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.undo-keywords-btn {
    background: #6767D9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.undo-keywords-btn:hover {
    background: #5555c7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(103, 103, 217, 0.3);
}

.undo-keywords-btn i {
    color: white;
    font-size: 14px;
}

.keywords-subsection {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.keywords-subsection:last-child {
    border-bottom: none;
}

.keywords-subsection h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.keyword-count {
    color: #6767D9;
    font-weight: 500;
    font-size: 14px;
}

.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.keyword-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.keyword-item:hover {
    background: #e9ecef;
    border-color: #6767D9;
}

.keyword-item:hover .keyword-actions {
    opacity: 1;
}

.keyword-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.keyword-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.keyword-actions button {
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.edit-keyword {
    background: #000 !important;
    color: white;
}

.edit-keyword:hover {
    background: #333;
    color: white;
}

.delete-keyword {
    background: #FC554F;
    color: white;
}

.delete-keyword:hover {
    background: #e74c3c;
    color: white;
}

/* Style de la poubelle (bin) */
.bin {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a) !important;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bin:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.bin::before {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M3 6l3 18h12l3-18h-18zm19-4v2h-20v-2h5.711c.9 0 1.631-1.099 1.631-2h5.316c0 .901.73 2 1.631 2h5.711z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* Competition Table */
.brief-competition-section {
    margin: 30px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Sélecteur de colonnes */
.competition-columns-selector {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.columns-selector-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.columns-selector-btn:hover {
    border-color: #6767D9;
    background: #f8f9ff;
    color: #6767D9;
}

.columns-selector-btn i {
    font-size: 14px;
}

.columns-selector-dropdown {
    position: absolute;
    top: 55px;
    left: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 200px;
}

.column-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 4px;
    font-size: 14px;
    user-select: none;
}

.column-toggle:hover {
    background: #f8f9ff;
}

.column-toggle input[type="checkbox"] {
    cursor: pointer;
}

.competition-table-container {
    overflow-x: auto;
}

.competition-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.competition-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.competition-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.competition-table tr:hover {
    background: #f8f9fa;
}

.url-link {
    color: #6767D9;
    text-decoration: none;
    font-weight: 500;
}

.url-link:hover {
    text-decoration: underline;
}

.title-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-cell {
    text-align: center;
    font-weight: 600;
}

.score-high {
    color: #24C789;
}

.score-medium {
    color: #F6A228;
}

.score-low {
    color: #FC554F;
}

.suroptimisation-warning {
    color: #FC554F;
    font-weight: 600;
}

.words-cell,
.tableaux-cell,
.images-cell {
    text-align: center;
}

.competition-export-checkbox {
    accent-color: #6767D9;
}

/* SERP Ratios */
.brief-serp-ratios {
    margin: 30px 0;
    background: white;
    border: 0px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

.serp-ratio-item.dominant {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    border-radius: 8px;
    min-width: 100%;
    text-align: center;
    color: #158966;
    background-color: #F6FFFB;
}

.ratio-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.ratio-value {
    font-size: 24px;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .brief-export-buttons {
        flex-direction: column;
    }
    
    .brief-metrics {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .keywords-grid {
        grid-template-columns: 1fr;
    }
    
    .competition-table {
        font-size: 12px;
    }
    
    .competition-table th,
    .competition-table td {
        padding: 8px 4px;
    }
    
    .title-cell {
        max-width: 150px;
    }
}

/* Styles pour les URLs avec flèche */
.url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.url-link {
    color: #6767D9;
    text-decoration: none;
    font-size: 12px;
    margin-right: 8px;
}

.url-link:hover {
    text-decoration: underline;
}

.url-arrow {
    color: #6767D9;
    text-decoration: none;
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.url-arrow:hover {
    opacity: 1;
    color: #4a4a9e;
}

/* Styles pour les checkboxes blanches */
input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    background-color: white !important;
    border: 2px solid #ccc !important;
    border-radius: 3px !important;
    position: relative !important;
    cursor: pointer !important;
}

input[type="checkbox"]:checked {
    background-color: #6767D9 !important;
    border-color: #6767D9 !important;
}

input[type="checkbox"]:checked::after {
    content: "✓" !important;
    position: absolute !important;
    top: -2px !important;
    left: 2px !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: bold !important;
}
