* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Botón para mostrar/ocultar menú */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: #5764e6;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.menu-toggle:active {
    transform: scale(0.95);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    color: #e0e0e0;
    padding-top: 20px; /* Reducido para dar más espacio a los archivos */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    position: fixed;
    top: 80px; /* Posicionado debajo del botón de menú */
    left: 20px;
    right: 20px;
    z-index: 98;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin-bottom: 15px;
    text-align: center;
    display: none; /* Oculto por defecto */
    transition: all 0.3s ease;
}

.header h1 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header p {
    color: #b0b0b0;
    font-size: 1rem;
}

.controls {
    position: fixed;
    top: 80px; /* Posicionado debajo del botón de menú */
    left: 20px;
    right: 20px;
    z-index: 99;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin-bottom: 0;
    display: none; /* Oculto por defecto */
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #555;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #404040;
    color: #e0e0e0;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    background: #4a4a4a;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #667eea;
    background: #404040;
    color: #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 6px 10px;
    border: 1px solid #667eea;
    background: #404040;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.view-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.view-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.view-btn.active {
    background: #667eea;
    color: white;
}

.files-container {
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    overflow: hidden;
    margin-top: 20px;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.list-view {
    display: none;
}

.list-view.active {
    display: block;
}

.grid-view.hidden {
    display: none;
}

.file-card {
    background: #404040;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border-color: #667eea;
    background: #4a4a4a;
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.file-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.file-thumbnail:hover {
    transform: scale(1.05);
}

.file-name {
    font-weight: 600;
    margin-bottom: 6px;
    word-break: break-word;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.file-type {
    color: #b0b0b0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.file-size {
    color: #888;
    font-size: 0.75rem;
    margin-top: 4px;
}

.file-date {
    color: #888;
    font-size: 0.75rem;
    margin-top: 2px;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #555;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.list-item:hover {
    background-color: #404040;
}

.list-item:last-child {
    border-bottom: none;
}

.list-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.list-info {
    flex: 1;
}

.list-name {
    font-weight: 600;
    margin-bottom: 2px;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.list-details {
    color: #b0b0b0;
    font-size: 0.8rem;
}

.list-thumbnail {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.breadcrumb {
    background: #404040;
    border: 1px solid #555;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 0.85rem;
}

.breadcrumb-item:hover {
    color: #8a9cff;
}

.breadcrumb-separator {
    color: #888;
}

.back-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
    margin-right: 12px;
}

.back-button:hover {
    background: #5a6fdb;
}

.refresh-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
}

.select-dir-btn {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.select-dir-btn:hover {
    background: #8e44ad;
    transform: translateY(-1px);
}

.generate-json-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.generate-json-btn:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

.refresh-btn.spinning {
    pointer-events: none;
}

.refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.status-bar {
    background: #404040;
    border: 1px solid #555;
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #b0b0b0;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 18px;
    background: #555;
    border-radius: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: #2ecc71;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(18px);
}

.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
}

.preview-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 8px;
    overflow: hidden;
}

.preview-header {
    padding: 15px;
    background: #404040;
    color: #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
}

.close-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ff6b6b;
}

.preview-body {
    padding: 15px;
    text-align: center;
    background: #2d2d2d;
}

.preview-image,
.preview-video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

.no-files {
    text-align: center;
    padding: 40px 20px;
    color: #b0b0b0;
}

.no-files i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #666;
}

.no-files h3 {
    color: #e0e0e0;
    margin-bottom: 8px;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #b0b0b0;
}

.loading i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #667eea;
    animation: spin 2s linear infinite;
}

.controls-row {
    display: flex;
    width: 100%;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Mensaje de bienvenida */
.welcome-message {
    background: #2d2d2d;
    border: 1px solid #555;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.welcome-message i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.welcome-message h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #e0e0e0;
}

.welcome-message > p {
    font-size: 1rem;
    margin-bottom: 25px;
    color: #b0b0b0;
}

.welcome-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.welcome-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.welcome-btn:active {
    transform: translateY(0);
}

.welcome-info {
    background: #404040;
    border: 1px solid #555;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.welcome-info p {
    margin-bottom: 8px;
    text-align: left;
    font-size: 0.85rem;
    color: #b0b0b0;
}

.welcome-info p:last-child {
    margin-bottom: 0;
}

/* Responsive para mensaje de bienvenida */
@media (max-width: 768px) {
    body {
        padding-top: 140px; /* Más espacio en móviles para la barra de controles */
    }
    
    .controls {
        left: 10px;
        right: 10px;
        padding: 12px;
    }
    
    .container {
        padding: 10px;
    }
    
    .welcome-message {
        padding: 20px 15px;
    }
    
    .welcome-options {
        flex-direction: column;
        align-items: center;
    }
    
    .welcome-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-toggle {
        align-self: center;
    }
}
