/* Fuente personalizada */
@font-face {
    font-family: 'A+CustomFont';
    src: url('fonts/STENCIL.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    color: #1f2937;
    line-height: 1.5;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Header minimalista */
header {
    padding-bottom: 24px;
    margin-bottom: 40px;
    border-bottom: 1px solid #f3f4f6;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

header h1 {
    font-family: 'A+CustomFont', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #111827;
    font-size: 28px;
    font-weight: normal;
    letter-spacing: -0.025em;
}

/* Panel de administrador minimalista */
.admin-panel {
    display: flex;
    align-items: center;
}

.admin-status {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    background: #f9fafb;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.admin-status i {
    color: #00A3E8;
    font-size: 14px;
}

.login-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-form input[type="password"] {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    font-size: 13px;
    color: #374151;
    min-width: 180px;
    transition: border-color 0.2s ease;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: #00A3E8;
    box-shadow: 0 0 0 3px rgba(0, 163, 232, 0.1);
}

.login-form input[type="password"]::placeholder {
    color: #9ca3af;
}

/* Mensajes */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid;
}

.message.success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

.message.error {
    background: #fef2f2;
    color: #dc2626;
    border-left-color: #ef4444;
}

.message i {
    margin-right: 8px;
}

/* Breadcrumb minimalista */
.breadcrumb {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #00A3E8;
}

.breadcrumb .current {
    color: #111827;
    font-weight: 500;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #d1d5db;
}

/* Botón Home con icono */
.breadcrumb .home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.breadcrumb .home-link i {
    font-size: 14px;
}

/* Acciones minimalistas */
.actions {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.action-group {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    flex: 1;
    min-width: 300px;
}

.action-group h3 {
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.inline-form {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.inline-form input[type="text"],
.inline-form input[type="file"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.inline-form input:focus {
    outline: none;
    border-color: #00A3E8;
    box-shadow: 0 0 0 3px rgba(0, 163, 232, 0.1);
}

.help-text {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 8px;
}

/* Botones minimalistas */
.btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}

.btn-primary {
    background: #00A3E8;
    color: white;
    border-color: #00A3E8;
}

.btn-primary:hover {
    background: #0284c7;
    border-color: #0284c7;
}

.btn-success {
    background: #059669;
    color: white;
    border-color: #059669;
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

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

/* Lista de archivos */
.file-list h3 {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 24px;
}

.empty-directory {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-directory i {
    font-size: 48px;
    color: #e5e7eb;
    margin-bottom: 16px;
    display: block;
}

.empty-directory p {
    font-size: 14px;
}

/* Grid ultra-minimalista */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2px;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.item {
    background: #ffffff;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background-color 0.2s ease;
    min-height: 200px;
}

.item:hover {
    background: #f9fafb;
}

/* Iconos minimalistas */
.item-icon {
    margin-bottom: 16px;
}

.item-icon i {
    font-size: 48px;
    color: #9ca3af;
}

/* Enlaces de iconos */
.icon-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease;
}

.icon-link:hover {
    transform: scale(1.1);
}

.icon-link i {
    transition: color 0.2s ease;
}

.icon-link:hover i {
    color: #00A3E8;
}

.item.folder .item-icon i {
    color: #00A3E8;
}

.item.folder .icon-link:hover i {
    color: #0284c7;
}

.item-icon i.fa-file-pdf {
    color: #dc2626;
}

.icon-link:hover i.fa-file-pdf {
    color: #b91c1c;
}

.item.file .item-icon i {
    color: #6b7280;
}

/* Preview de imágenes minimalista */
.image-preview {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    width: 100%;
    height: 100%;
}

/* Información del archivo */
.item-info {
    flex: 1;
    margin-bottom: 16px;
    width: 100%;
}

.item-name {
    margin-bottom: 8px;
}

.item-name a {
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    transition: color 0.2s ease;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    white-space: normal;
    max-height: 36px;
    word-break: break-word;
}

.item-name a:hover {
    color: #00A3E8;
}

.item-details {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Acciones del archivo */
.item-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    /* Botón Home discreto para tablets/iPads - SOLO ICONO */
    .breadcrumb .home-link {
        background: #f3f4f6;
        color: #6b7280;
        padding: 12px;
        border-radius: 10px;
        font-weight: 500;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        min-width: 48px;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #e5e7eb;
    }

    .breadcrumb .home-link:hover {
        background: #00A3E8;
        color: white;
        transform: scale(1.05);
        box-shadow: 0 4px 8px rgba(0, 163, 232, 0.3);
        border-color: #00A3E8;
    }

    .breadcrumb .home-link i {
        font-size: 22px;
    }

    /* Ocultar el texto "Home" en tablets/móviles */
    .breadcrumb .home-text {
        display: none;
    }

    /* Contenido más grande en tablets */
    .container {
        padding: 32px 20px;
    }

    header h1 {
        font-size: 24px;
    }

    .breadcrumb {
        font-size: 15px;
        margin-bottom: 28px;
    }

    .file-list h3 {
        font-size: 18px;
        margin-bottom: 28px;
    }

    /* Grid más espacioso */
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 3px;
    }

    /* Items más grandes */
    .item {
        padding: 36px 28px;
        min-height: 220px;
    }

    /* Iconos más grandes */
    .item-icon i {
        font-size: 56px;
    }

    /* Preview de imágenes más grande */
    .image-preview {
        width: 140px;
        height: 140px;
    }

    /* Nombres de archivos más grandes */
    .item-name a {
        font-size: 16px;
        line-height: 1.5;
        max-height: 50px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .item-name {
        margin-bottom: 12px;
    }

    /* Detalles más grandes */
    .item-details {
        font-size: 14px;
    }

    /* Botones más grandes */
    .btn-small {
        padding: 8px 14px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
    }

    .actions {
        flex-direction: column;
    }

    .inline-form {
        flex-direction: column;
        gap: 8px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    header h1 {
        font-size: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 12px;
    }

    .items-grid {
        grid-template-columns: 1fr 1fr;
    }

    .item {
        padding: 24px 16px;
        min-height: 160px;
    }

    .item-icon i {
        font-size: 40px;
    }

    .image-preview {
        width: 80px;
        height: 80px;
    }

    /* Ajustar nombres de archivos en móviles */
    .item-name a {
        line-height: 1.5;
        max-height: 48px;
    }

    .item-name {
        margin-bottom: 12px;
    }

    /* Botón Home ligeramente más grande en móviles pequeños */
    .breadcrumb .home-link {
        padding: 14px;
        min-width: 52px;
        min-height: 52px;
        border-radius: 12px;
    }

    .breadcrumb .home-link i {
        font-size: 24px;
    }
}

/* Utilidades */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

form[onsubmit] {
    display: inline;
}

::selection {
    background: rgba(0, 163, 232, 0.2);
}


button:focus,
input:focus {
    outline: none;
}

/* Lightbox para galería de imágenes */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.lightbox-close:hover {
    color: #00A3E8;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 30px;
    padding: 20px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10000;
}

.lightbox-arrow:hover {
    background: rgba(0, 163, 232, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: white;
}

#lightbox-filename {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f8fafc;
}

#lightbox-counter {
    font-size: 14px;
    color: #cbd5e1;
}

/* Cursor pointer para miniaturas */
.image-preview {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.image-preview:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Estilo para enlaces de imágenes */
.image-link {
    cursor: pointer;
}

.image-link:hover {
    color: #00A3E8 !important;
}

/* Responsive para lightbox */
@media (max-width: 768px) {
    .lightbox-arrow {
        font-size: 24px;
        padding: 15px 12px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }
    
    #lightbox-img {
        max-height: 70vh;
    }
    
    #lightbox-filename {
        font-size: 14px;
    }
    
    #lightbox-counter {
        font-size: 12px;
    }
}
