* {
    box-sizing: border-box;
}
body {
    font-family: 'Arial', sans-serif;
    background-color: #2b2d31;
    color: #ffffff;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.container {
    width: 90%;
    max-width: 600px;
    padding: 30px;
    background-color: #36393f;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s;
    text-align: center;
    margin-top: 20px;
}
.container:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
h1, h2 {
    color: #ffffff;
}
nav {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
nav button {
    background: none;
    border: none;
    color: #b9bbbe;
    font-size: 1.2em;
    margin: 0 10px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s;
}
nav button.active {
    background-color: #5865f2;
    color: white;
    font-weight: bold;
}
nav button:hover {
    background-color: #40444b;
    transform: scale(1.05);
}
.a-button {
    background: none;
    border: none;
    color: #b9bbbe;
    font-size: 1.2em;
    margin: 0 10px;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none;
}
.a-button:hover {
    background-color: #40444b;
    transform: scale(1.05);
}
input[type="text"] {
    width: 100%;
    padding: 12px;
    font-size: 1.2em;
    border: 2px solid #666;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #202225;
    color: white;
}
input[type="text"]:focus {
    border-color: #5865f2;
    outline: none;
}
#searchButton {
    padding: 12px 20px;
    font-size: 1.2em;
    color: white;
    background-color: #5865f2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
}
#searchButton:hover {
    background-color: #4752c4;
    transform: translateY(-2px);
}
#searchButton:active {
    transform: translateY(1px);
}
.sections {
    display: flex;
    overflow-x: auto;
    width: 100%;
    height: calc(100vh - 280px);
    scroll-snap-type: x mandatory;
}
.section {
    min-width: 100vw;
    height: 100%;
    padding: 20px;
    background-color: #2b2d31;
    text-align: center;
    border-top: 1px solid #202225;
    scroll-snap-align: start;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.grid a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    background-color: #36393f;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    max-width: 250px;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 1.5em;
}
.grid a:hover {
    background-color: #40444b;
    transform: scale(1.05);
}
.grid img {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    border-radius: 8px;
}
/* Scrollbar dark mode */
::-webkit-scrollbar {
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0e1117;
}

::-webkit-scrollbar-thumb {
    background-color: #1e90ff;
    border-radius: 10px;
    border: 2px solid #0e1117;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #006bb3;
}
/* --- NUEVOS ESTILOS A AÑADIR A TU STYLE.CSS --- */

/* Efecto Glassmorphism */
.glass-effect {
    background: rgba(54, 57, 63, 0.7) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Reloj */
.clock-widget {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Colores de categorías */
.color-multimedia { color: #ff5e5e; }
.color-utilidades { color: #43b581; }
.color-entretenimiento { color: #faa61a; }
.color-educacion { color: #00b0f4; }
.color-programacion { color: #9b59b6; }

/* Botones de eliminar y añadir */
.grid a {
    position: relative; /* Necesario para el botón de eliminar */
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ed4245;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: none; /* Se oculta por defecto */
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.grid a:hover .delete-btn {
    display: flex; /* Se muestra al pasar el ratón */
}

.add-btn {
    justify-content: center;
    background-color: rgba(255,255,255,0.05) !important;
    border: 2px dashed #666 !important;
    color: #b9bbbe !important;
}

.add-btn:hover {
    border-color: #5865f2 !important;
    color: white !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
}
.modal-buttons button {
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}
#saveLinkBtn { background: #5865f2; color: white; width: 48%; }
#cancelLinkBtn { background: #ed4245; color: white; width: 48%; }
/* --- SUGERENCIAS --- */
.suggestions-box {
    position: absolute;
    width: calc(100% - 60px); /* Alineado con el padding del container */
    background: rgba(43, 45, 49, 0.95);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 100;
    text-align: left;
    display: none; /* Se activa con JS */
    overflow: hidden;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.suggestion-item:hover {
    background: #5865f2;
}

/* --- MODO COMPACTO --- */
/* Cuando el grid tenga la clase .compact, cambiará el estilo */
.grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.grid.compact a {
    padding: 10px;
    font-size: 1em;
}

.grid.compact img {
    width: 30px;
    height: 30px;
}

.view-controls {
    margin: 10px 0;
}

#toggleViewBtn {
    background: #40444b;
    border: 1px solid #666;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8em;
}