/*
    ========================================
    CONFIGURACIÓN GENERAL
    ========================================
*/

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

:root {
--primary-color: #1e3a8a;
--secondary-color: #2563eb;
--background-color: #f4f6f9;
--white-color: #ffffff;
--text-color: #333333;
--muted-color: #667085;
--border-color: #d9dee7;
--success-color: #15803d;
--success-background: #dcfce7;
--error-color: #b42318;
--error-background: #fee4e2;
--shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

body {
min-height: 100vh;
font-family: Arial, Helvetica, sans-serif;
background: var(--background-color);
color: var(--text-color);
}

/*
    ========================================
    DISTRIBUCIÓN DE LA APLICACIÓN
    ========================================
*/

.app-container {
display: flex;
min-height: 100vh;
}

/*
    ========================================
    MENÚ LATERAL
    ========================================
*/

.sidebar {
width: 260px;
flex-shrink: 0;
padding: 25px;
background: var(--primary-color);
color: var(--white-color);
}

.sidebar h2 {
margin-bottom: 30px;
font-size: 21px;
line-height: 1.4;
}

.sidebar nav {
display: flex;
flex-direction: column;
gap: 6px;
}

.sidebar a {
display: block;
padding: 11px 12px;
color: var(--white-color);
text-decoration: none;
border-radius: 7px;
transition:
background-color 0.2s,
transform 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
background: rgba(255, 255, 255, 0.16);
}

.sidebar a:hover {
transform: translateX(3px);
}

/*
    ========================================
    CONTENIDO PRINCIPAL
    ========================================
*/

.main-content {
flex: 1;
min-width: 0;
padding: 40px;
}

.top-header {
padding: 25px;
margin-bottom: 30px;
background: var(--white-color);
border-radius: 10px;
box-shadow: var(--shadow);
}

.top-header h1 {
margin-bottom: 8px;
color: var(--primary-color);
font-size: 30px;
}

.top-header p {
color: var(--muted-color);
font-size: 16px;
}

/*
========================================
TARJETAS DE ESTADÍSTICAS
========================================
*/

.stats-container {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 20px;
}

.card {
padding: 25px;
background: var(--white-color);
border-radius: 10px;
box-shadow: var(--shadow);
}

.card h3 {
margin-bottom: 15px;
color: var(--muted-color);
font-size: 16px;
}

.card strong {
display: block;
margin-bottom: 8px;
color: var(--primary-color);
font-size: 32px;
}

.card p {
color: var(--muted-color);
font-size: 14px;
}

/*
    ========================================
    SECCIONES
    ========================================
*/

.projects,
.website-analyzer,
.quick-actions {
margin-top: 40px;
padding: 25px;
background: var(--white-color);
border-radius: 10px;
box-shadow: var(--shadow);
}

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

.website-analyzer h2,
.quick-actions h2 {
margin-bottom: 10px;
}

.website-analyzer > p {
margin-bottom: 20px;
color: var(--muted-color);
}

/*
    ========================================
    TABLA DE CLIENTES
    ========================================
*/

.table-container {
width: 100%;
overflow-x: auto;
}

table {
width: 100%;
min-width: 800px;
border-collapse: collapse;
}

th {
padding: 12px;
background: var(--background-color);
color: #344054;
text-align: left;
font-size: 14px;
}

td {
padding: 14px 12px;
border-bottom: 1px solid #eeeeee;
font-size: 14px;
vertical-align: middle;
}

tbody tr:hover {
background: #f8fafc;
}

.website-link {
color: var(--secondary-color);
text-decoration: none;
word-break: break-word;
}

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

.status-badge {
display: inline-block;
padding: 5px 9px;
border-radius: 20px;
font-size: 12px;
font-weight: bold;
}

.status-badge.active {
color: var(--success-color);
background: var(--success-background);
}

.empty-message {
display: none;
padding: 30px 15px;
color: var(--muted-color);
text-align: center;
}

.empty-message.show {
display: block;
}

/*
    ========================================
    BOTONES
    ========================================
*/

button {
font-family: inherit;
}

.primary-button,
.secondary-button,
.action-button,
.delete-button {
border: none;
border-radius: 8px;
cursor: pointer;
transition:
background-color 0.2s,
color 0.2s,
transform 0.2s;
}

.primary-button {
padding: 12px 20px;
background: var(--primary-color);
color: var(--white-color);
font-size: 15px;
}

.primary-button:hover {
background: var(--secondary-color);
transform: translateY(-1px);
}

.primary-button:disabled {
background: #98a2b3;
cursor: not-allowed;
transform: none;
}

.secondary-button {
padding: 12px 20px;
background: #e5e7eb;
color: var(--text-color);
font-size: 15px;
}

.secondary-button:hover {
background: #d1d5db;
}

.delete-button {
padding: 8px 12px;
background: var(--error-background);
color: var(--error-color);
font-weight: bold;
}

.delete-button:hover {
background: var(--error-color);
color: var(--white-color);
}

.actions-container {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-top: 20px;
}

.action-button {
padding: 15px 25px;
background: #e5e7eb;
color: var(--text-color);
font-size: 15px;
}

.action-button:hover {
background: var(--secondary-color);
color: var(--white-color);
transform: translateY(-1px);
}

/*
    ========================================
    ANALIZADOR
    ========================================
*/

.analyzer-form {
display: flex;
align-items: flex-end;
gap: 15px;
}

.analyzer-form label {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
}

.analyzer-form input {
flex: 1;
min-width: 0;
padding: 12px;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 15px;
}

.analysis-result {
display: none;
margin-top: 20px;
padding: 14px;
border-radius: 8px;
}

.analysis-result.show {
display: block;
}

.analysis-result.loading {
color: #1d4ed8;
background: #dbeafe;
}

.analysis-result.success {
color: var(--success-color);
background: var(--success-background);
}

.analysis-result.error {
color: var(--error-color);
background: var(--error-background);
}

/*
    ========================================
    MODAL
    ========================================
*/

.modal {
position: fixed;
z-index: 1000;
inset: 0;
display: none;
align-items: center;
justify-content: center;
padding: 20px;
overflow-y: auto;
background: rgba(0, 0, 0, 0.55);
}

.modal.show {
display: flex;
}

.modal-content {
width: min(500px, 100%);
max-height: calc(100vh - 40px);
padding: 30px;
overflow-y: auto;
background: var(--white-color);
border-radius: 12px;
box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
}

.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
margin-bottom: 25px;
}

.modal-header h2 {
margin: 0;
}

#closeModalButton {
padding: 3px 8px;
background: none;
border: none;
color: #667085;
font-size: 30px;
line-height: 1;
cursor: pointer;
}

#closeModalButton:hover {
color: #000000;
}

.form-group {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}

.form-group label {
margin-bottom: 8px;
font-weight: bold;
}

.form-group input {
width: 100%;
padding: 12px;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 15px;
}

.form-group input:focus,
.analyzer-form input:focus {
border-color: var(--secondary-color);
outline: 3px solid rgba(37, 99, 235, 0.15);
}

.form-message {
display: none;
margin-bottom: 20px;
padding: 12px;
border-radius: 8px;
}

.form-message.error {
display: block;
color: var(--error-color);
background: var(--error-background);
}

.modal-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
}

/*
    ========================================
    ACCESIBILIDAD
    ========================================
*/

button:focus-visible,
a:focus-visible {
outline: 3px solid #fbbf24;
outline-offset: 3px;
}

/*
    ========================================
    TABLETAS
    ========================================
*/

@media (max-width: 1000px) {
.stats-container {
grid-template-columns: repeat(2, 1fr);
}

.main-content {
padding: 25px;
}
}

/*
    ========================================
    TELÉFONOS
    ========================================
*/

@media (max-width: 700px) {
.app-container {
flex-direction: column;
}

.sidebar {
width: 100%;
padding: 20px;
}

.sidebar h2 {
margin-bottom: 20px;
}

.sidebar nav {
display: grid;
grid-template-columns: repeat(2, 1fr);
}

.sidebar a:hover {
transform: none;
}

.main-content {
padding: 18px;
}

.top-header {
padding: 20px;
}

.top-header h1 {
font-size: 25px;
}

.stats-container {
grid-template-columns: 1fr;
}

.section-header {
align-items: stretch;
flex-direction: column;
}

.section-header .primary-button {
width: 100%;
}

.analyzer-form {
align-items: stretch;
flex-direction: column;
}

.analyzer-form .primary-button {
width: 100%;
}

.actions-container {
flex-direction: column;
}

.action-button {
width: 100%;
}

.modal {
padding: 15px;
}

.modal-content {
padding: 22px;
}

.modal-actions {
flex-direction: column-reverse;
}

.modal-actions button {
width: 100%;
}
}

@media (max-width: 420px) {
.sidebar nav {
grid-template-columns: 1fr;
}
}

/*
    ========================================
    FICHA INDIVIDUAL DEL CLIENTE
    ========================================
*/

.client-details-content {
    width: min(850px, 100%);
}

/*
    Texto pequeño sobre el nombre del cliente
*/

.modal-subtitle {
    margin-bottom: 5px;
    color: var(--muted-color);
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/*
    Botón X de la ficha
*/

#closeDetailsButton {
    padding: 3px 8px;
    background: none;
    border: none;
    color: #667085;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

#closeDetailsButton:hover {
    color: #000000;
}

/*
    Secciones internas
*/

.client-information,
.client-connections,
.client-tools {
    margin-bottom: 30px;
}

.client-information h3,
.client-connections h3,
.client-tools h3 {
    color: var(--primary-color);
}

.client-information > h3,
.client-tools > h3 {
    margin-bottom: 18px;
}

/*
    Cuadrícula con los datos del negocio
*/

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e7ebf0;
    border-radius: 9px;
}

.detail-item span {
    color: var(--muted-color);
    font-size: 13px;
}

.detail-item strong {
    color: var(--text-color);
    font-size: 15px;
}

.detail-item a {
    color: var(--secondary-color);
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    word-break: break-word;
}

.detail-item a:hover {
    text-decoration: underline;
}

/*
    Encabezado de plataformas
*/

.details-section-header {
    margin-bottom: 18px;
}

.details-section-header h3 {
    margin-bottom: 6px;
}

.details-section-header p {
    color: var(--muted-color);
    font-size: 14px;
}

/*
    Tarjetas de las plataformas
*/

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.platform-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
}

.platform-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-name h4 {
    margin-bottom: 4px;
}

.platform-name p {
    color: var(--muted-color);
    font-size: 13px;
}

/*
    Círculo con el símbolo de cada plataforma
*/

.platform-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #e8efff;
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
}

/*
    Botón Connect
*/

.connect-button {
    padding: 9px 13px;
    background: var(--white-color);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 7px;
    font-weight: bold;
    cursor: pointer;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.connect-button:hover {
    background: var(--secondary-color);
    color: var(--white-color);
}

/*
    Herramientas del cliente
*/

.client-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.client-tool-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    min-height: 100px;
    padding: 15px;
    background: #f8fafc;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    font-weight: bold;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background-color 0.2s,
        transform 0.2s;
}

.client-tool-button span {
    font-size: 25px;
}

.client-tool-button:hover {
    background: #eff6ff;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/*
    Botones View y Delete en la tabla
*/

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-button {
    padding: 8px 12px;
    background: #dbeafe;
    color: #1d4ed8;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.view-button:hover {
background: var(--secondary-color);
color: var(--white-color);
}

/*
    ========================================
    FICHA EN TABLETAS Y TELÉFONOS
    ========================================
*/

@media (max-width: 750px) {
.details-grid,
.platforms-grid {
grid-template-columns: 1fr;
}

.client-tools-grid {
grid-template-columns: repeat(2, 1fr);
}
}

@media (max-width: 450px) {
.platform-card {
align-items: stretch;
flex-direction: column;
}

.connect-button {
width: 100%;
}

.client-tools-grid {
grid-template-columns: 1fr;
}
}

/*
========================================
BUSCADOR Y FILTROS DE CLIENTES
========================================
*/

.clients-toolbar {
display: flex;
align-items: flex-end;
gap: 15px;
margin-bottom: 20px;
}

.search-group,
.filter-group {
display: flex;
flex-direction: column;
gap: 7px;
}

.search-group {
flex: 1;
}

.search-group label,
.filter-group label {
color: var(--muted-color);
font-size: 13px;
font-weight: bold;
}

.search-group input,
.filter-group select {
width: 100%;
height: 43px;
padding: 10px 12px;
background: var(--white-color);
border: 1px solid var(--border-color);
border-radius: 8px;
color: var(--text-color);
font-family: inherit;
font-size: 14px;
}

.search-group input:focus,
.filter-group select:focus {
border-color: var(--secondary-color);
outline: 3px solid rgba(37, 99, 235, 0.15);
}

.filter-group {
width: 190px;
}

@media (max-width: 600px) {
.clients-toolbar {
align-items: stretch;
flex-direction: column;
}

    .filter-group {
        width: 100%;
    }
}

/*
    Client status selector
*/

.form-group select {
width: 100%;
padding: 12px;
background: var(--white-color);
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 15px;
}

.form-group select:focus {
border-color: var(--secondary-color);
outline: 3px solid rgba(37, 99, 235, 0.15);
}

/*
    Client status colors
*/

.status-badge.paused {
color: #9a6700;
background: #fef3c7;
}

.status-badge.archived {
color: #475467;
background: #e5e7eb;
}

/*
    AI Content page
*/

.ai-content-section {
    display: none;
}

/*
    ========================================
    AI CONTENT PAGE
    ========================================
*/

.ai-content-section {
    display: none;
    padding: 25px;
    background: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.ai-content-section .section-header {
    margin-bottom: 25px;
}

.ai-content-section .section-header h2 {
    margin-bottom: 6px;
    color: var(--text-color);
}

.ai-content-section .section-header p {
    color: var(--muted-color);
}

.content-form {
    display: grid;
    gap: 20px;
}

.content-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
}

.content-form textarea:focus {
    border-color: var(--secondary-color);
    outline: 3px solid rgba(37, 99, 235, 0.15);
}

.platform-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.platform-selection legend {
    padding: 0 8px;
    font-weight: bold;
}

.platform-selection label {
    display: flex;
    gap: 7px;
    align-items: center;
    cursor: pointer;
}

.generated-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.generated-content-card {
    padding: 20px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--secondary-color);
    border-radius: 10px;
}

.generated-content-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.generated-content-card p {
    line-height: 1.6;
}

@media (max-width: 800px) {
    .generated-content {
        grid-template-columns: 1fr;
    }
}

.generated-content-card p {
    margin-top: 10px;
    line-height: 1.6;
    white-space: pre-line;
}

/*
    ========================================
    COPY CONTENT BUTTON
    ========================================
*/

.copy-content-button {
    margin-top: 16px;
    padding: 9px 14px;
    color: var(--primary-color);
    background: var(--white-color);
    border: 1px solid var(--primary-color);
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.copy-content-button:hover {
    color: var(--white-color);
    background: var(--primary-color);
}

.generated-content-card p {
    margin-top: 10px;
    line-height: 1.6;
    white-space: pre-line;
}

/*
    ========================================
    CAMPAIGNS PAGE
    ========================================
*/

.campaigns-section {
    display: none;
    padding: 25px;
    background: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.campaigns-section .section-header {
    margin-bottom: 25px;
}

