/* Estilos base y modo claro */
html, body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    height: 100%; /* Asegura que html y body ocupen el 100% de la altura */
    width: 100%; /* Asegura que html y body ocupen el 100% del ancho */
}

html {
    background-color: #f4f7f9; /* Fondo base para el html */
}
html.dark {
    background-color: #121212; /* Fondo base para el html en modo oscuro */
}


body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f7f9; /* Fondo claro general */
    color: #333;
    display: flex; /* Añade flexbox al body */
    flex-direction: column; /* Organiza los elementos en columna */
}

.header {
    background-color: #2c3e50; /* Azul oscuro para header */
    padding: 15px 30px;
    display: flex;
    align-items: center;
    border-bottom: 3px solid #3498db; /* Borde azul */
    color: #ecf0f1;
    width: 100%; /* Asegura que el header ocupe todo el ancho */
    box-sizing: border-box; /* Incluye padding y borde en el ancho total */
}

.header img {
    width: 50px;
    height: auto;
    margin-right: 20px;
    border-radius: 50%;
}

.header h1 {
    flex: 1;
    text-align: center;
    font-size: 2.2rem;
    margin: 0;
}

.container {
    max-width: 1200px; /* Aumenta el max-width para que sea más amplio */
    width: 90%; /* Usa un porcentaje para el ancho, adaptándose a la pantalla */
    margin: 30px auto;
    padding: 20px;
    background-color: #ffffff; /* Contenedor blanco */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-grow: 1; /* Permite que el contenedor crezca y ocupe el espacio disponible */
}

section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #ecf0f1; /* Secciones ligeramente diferentes del fondo */
    border-radius: 8px;
    border: 1px solid #dfe6e9;
}

section h2 {
    font-size: 1.8rem;
    color: #2c3e50; /* Color de título de sección oscuro */
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top:0;
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    column-gap: 15px; /* Espacio horizontal */
    row-gap: 15px;    /* Espacio vertical */
    justify-content: center;
}

.api-button-container {
    display: flex;
    flex-wrap: wrap; /* Para que los botones se envuelvan si no caben */
    gap: 10px; /* Margen entre los botones, ajusta este valor si es necesario */
    justify-content: center; /* Centra los botones horizontalmente si es necesario */
}

.button {
    display: inline-block;
    background-color: #3498db; /* Azul principal */
    color: #ffffff !important; /* Asegurar texto blanco */
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1rem;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none; /* Quitar borde por defecto de botones */
    cursor: pointer;
}

.button:hover {
    background-color: #2980b9; /* Azul más oscuro al pasar el mouse */
    transform: translateY(-2px);
}

.api-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.api-item {
    background-color: #ffffff; /* Items de API blancos */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dfe6e9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column; /* Para alinear el botón al final si es necesario */
}

.api-item h3 {
    font-size: 1.4rem;
    color: #e67e22; /* Naranja para títulos de API */
    margin-top: 0;
    margin-bottom: 10px;
}

.api-item p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: #555;
    flex-grow: 1; /* Para que el texto ocupe espacio y empuje el botón hacia abajo si es necesario */
}

.api-button {
    background-color: #e67e22; /* Naranja para botones de API */
    align-self: flex-start; /* Para que no ocupe todo el ancho si el texto es corto */
}
.api-button:hover {
    background-color: #d35400;
}

/* Grupo de input para API HLTV */
.api-input-group {
    margin-bottom: 15px;
}
.api-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #555;
}
.api-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Para que el padding no afecte el ancho total */
    font-size: 1rem;
    margin-bottom: 10px;
}
html.dark .api-input {
    background-color: #333;
    border-color: #555;
    color: #e0e0e0;
}
html.dark .api-label {
    color: #bbb;
}


/* IDs de ejemplo para API HLTV */
.api-example-ids {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #666;
}
.api-example-ids p {
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}
.api-example-ids ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}
.api-example-ids li {
    margin-bottom: 3px;
}
.api-example-ids code {
    background-color: #e9ecef;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
    color: #c7254e;
    word-wrap: break-word;
}

html.dark .api-example-ids {
    color: #aaa;
}
html.dark .api-example-ids code {
    background-color: #3a3a3a;
    color: #ff8c8c;
}


footer, .custom-footer {
    text-align: center;
    padding: 20px;
    background-color: #2c3e50; /* Footer azul oscuro */
    color: #bdc3c7; 
    font-size: 0.9rem;
    border-top: 3px solid #3498db;
    margin-top: 40px;
    width: 100%; /* Asegura que el footer ocupe todo el ancho */
    box-sizing: border-box; /* Incluye padding y borde en el ancho total */
}

/* Botón de Volver */
.back-button-container {
    text-align: center;
    margin: 20px 0 10px 0; /* Ajuste de margen */
}

.back-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #e67e22; /* Naranja para destacar */
    color: white !important; /* Asegurar color del texto */
    text-decoration: none;
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none; /* Quitar borde por defecto de botones */
    cursor: pointer;
}

.back-button:hover {
    background-color: #d35400; /* Naranja más oscuro */
    transform: translateY(-1px);
}


/* Estilos del botón de modo oscuro */
.theme-toggle-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8); /* Fondo más opaco */
    color: #333; 
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.theme-toggle-button:hover {
    background-color: rgba(240, 240, 240, 0.9);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.theme-toggle-button svg {
    width: 20px;
    height: 20px;
    display: block; /* Para evitar espacio extra debajo del svg */
}
.theme-toggle-button .hidden { /* Tailwind ya define .hidden */
    display: none !important;
}

/* Modo Oscuro */
html.dark body {
    background-color: #121212;
    color: #e0e0e0;
}
html.dark .header {
    background-color: #1f1f1f;
    border-bottom-color: #005f73;
    color: #e0e0e0;
}
html.dark .header h1 {
    color: #e0e0e0;
}
html.dark .container {
    background-color: #1e1e1e;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
html.dark section {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
}
html.dark section h2 {
    color: #00a8cc;
    border-bottom-color: #00778f;
}
html.dark .button {
    background-color: #00778f;
    color: #ffffff !important;
}
html.dark .button:hover {
    background-color: #005f73;
}
html.dark .api-item {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
}
html.dark .api-item h3 {
    color: #f39c12; 
}
html.dark .api-item p {
    color: #bdc3c7;
}
html.dark .api-button {
    background-color: #f39c12;
}
html.dark .api-button:hover {
    background-color: #e67e22;
}
html.dark footer, html.dark .custom-footer {
    background-color: #1f1f1f;
    color: #9e9e9e;
    border-top-color: #005f73;
}
html.dark .theme-toggle-button {
    background-color: rgba(40, 40, 40, 0.8);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
html.dark .theme-toggle-button:hover {
    background-color: rgba(50, 50, 50, 0.9);
     box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}
html.dark .back-button {
    background-color: #f39c12;
}
html.dark .back-button:hover {
    background-color: #e67e22;
}


/* Media Queries para responsividad */
@media (max-width: 768px) {
    .header h1 { font-size: 1.8rem; }
    .container { margin: 20px auto; padding: 15px; width: 90%; } /* Ajusta el margen y ancho */
    section h2 { font-size: 1.6rem; }
    .button, .api-button, .back-button { padding: 10px 20px; font-size: 1rem; }
    .api-item h3 { font-size: 1.2rem; }
    .api-input { font-size: 0.95rem; }
}
@media (max-width: 480px) {
    .header { padding: 10px 15px; flex-direction: column; }
    .header img { margin-bottom: 10px; }
    .header h1 { font-size: 1.5rem; }
    .button-group { flex-direction: column; }
    .button, .api-button, .back-button { width: 100%; box-sizing: border-box; }
    .api-links { grid-template-columns: 1fr; } /* Una columna en móviles para API items */
    .container { margin: 15px auto; padding: 10px; width: 95%; } /* Más ajustes para móviles pequeños */
}