/* ============================
   RESET BÁSICO
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    background: #f4f6f8;
    color: #333;
}

/* ============================
   TOPBAR
============================ */
.topbar {
    background: #ffffff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    font-size: 24px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    font-size: 14px;
    color: #555;
}

/* ============================
   BOTONES
============================ */
.btn,
button {
    background: #1976d2;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.btn:hover,
button:hover {
    background: #0d5ba8;
}

.btn.small {
    padding: 6px 10px;
    font-size: 13px;
}

.btn.red {
    background: #d32f2f;
}

.btn.red:hover {
    background: #b71c1c;
}

.btn-delete {
    background: #d32f2f;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    color: white;
}

.btn-delete:hover {
    background: #b71c1c;
}

.btn-copy {
    background: #4caf50;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: white;
}

.btn-copy:hover {
    background: #3d8b41;
}

/* ============================
   CONTENEDOR PRINCIPAL
============================ */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 25px auto;
}

/* ============================
   BUSCADOR
============================ */
.search-box {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    font-size: 15px;
}

/* ============================
   GRID DE ICONOS
============================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 18px;
}

.card {
    background: #ffffff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: 0.2s;
    position: relative;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.icon-preview {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 10px;
}

.icon-name {
    font-size: 13px;
    color: #444;
    margin-bottom: 10px;
    word-break: break-all;
}

/* ============================
   OCULTAR BOTONES POR DEFECTO
============================ */
.icon-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* ============================
   MOSTRAR BOTONES AL HOVER
============================ */
.card:hover .icon-actions {
    opacity: 1;
    pointer-events: auto;
}

/* ============================
   RENOMBRADO INLINE
============================ */
.icon-name.editable {
    cursor: pointer;
    padding: 3px;
    font-weight: 600;
}

.rename-input {
    width: 100%;
    padding: 4px;
    font-size: 13px;
}

/* ============================
   FORMULARIOS
============================ */
.login-box,
.upload-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    width: 350px;
    margin: 50px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-box h2 {
    margin-bottom: 20px;
    text-align: center;
}

.login-box input,
.upload-box input,
.upload-box select {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.upload-box label {
    font-size: 14px;
    margin-bottom: 5px;
    display: block;
}

/* ============================
   MENSAJES
============================ */
.error {
    background: #ffdddd;
    color: #b30000;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}

.info {
    background: #e0f7fa;
    color: #006064;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}
/* ================================
   PREVIEW DE FUENTES
   ================================ */

.thumb {
    width: 140px;
    height: 140px;
    background: #f3f3f3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.no-preview {
    font-size: 14px;
    color: #777;
    text-align: center;
}

/* Nombre editable (si no existe en tu CSS) */
.icon-name.editable:hover {
    color: #007bff;
}
.visor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.visor img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}