/* fcollect - Estilos principales */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    visibility: visible;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-screen p {
    color: white;
    font-size: 1.2rem;
    font-weight: 300;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.header-button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.header-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.app-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #667eea;
}

/* Navigation Menu */
.navigation-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    overflow-y: auto;
}

.navigation-menu:not(.hidden) {
    transform: translateX(0);
}

.menu-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name {
    font-weight: 500;
    display: block;
}

.user-role {
    font-size: 0.9rem;
    opacity: 0.8;
}

.menu-items {
    padding: 1rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s ease;
}

.menu-item:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.menu-item.active {
    background-color: rgba(102, 126, 234, 0.15);
    color: #667eea;
    font-weight: 600;
    border-left: 4px solid #667eea;
    padding-left: calc(1rem - 4px);
    /* Compensate border */
}

.menu-item.active .material-icons {
    color: #667eea;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Bottom Navigation Moderno (Fijo) */
.bottom-navigation {
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 100;
    border-top: 1px solid #f0f0f0;
}

.nav-button {
    background: none;
    border: none;
    padding: 8px 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #90a4ae;
    /* Gris suave */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 12px;
    flex: 1;
    max-width: 80px;
}

.nav-button:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.nav-button.active {
    color: #667eea;
}

.nav-button .material-icons {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.nav-button.active .material-icons {
    transform: translateY(-3px);
    text-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.nav-button span:last-child {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-button.active span:last-child {
    opacity: 1;
    font-weight: 600;
}

/* Indicador de punto activo */
.nav-button.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #667eea;
    border-radius: 50%;
    box-shadow: 0 0 6px #667eea;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff9800;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.offline-indicator.hidden {
    transform: translateX(100%);
}

/* Sync Status */
.sync-status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2196f3;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.sync-status.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinning {
    animation: spin 1s linear infinite;
}

/* Modals */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-container:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.toast {
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: #4caf50;
}

.toast.error {
    background: #f44336;
}

.toast.warning {
    background: #ff9800;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

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

.btn-block {
    width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 0.5rem;
    }

    .navigation-menu {
        width: 85%;
        max-width: 300px;
    }

    .bottom-navigation {
        padding: 0.25rem 0;
    }
}

/* Upload Styles */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.upload-form-container {
    background: var(--surface-color, white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-upload-area.drag-over {
    border-color: #667eea;
    background: #e8f2ff;
    transform: scale(1.02);
}

.file-upload-area .material-icons {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.file-hint {
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0f4ff;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.upload-instructions {
    background: var(--surface-color, white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.upload-instructions h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-instructions ul {
    list-style: none;
    padding: 0;
}

.upload-instructions li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.upload-instructions li:last-child {
    border-bottom: none;
}

.upload-instructions li::before {
    content: "📋";
    margin-right: 0.5rem;
}

/* Apps Header */
.apps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.apps-header h1 {
    margin: 0;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Auth Required */
.auth-required {
    text-align: center;
    padding: 3rem 1rem;
}

.auth-required p {
    margin-bottom: 1rem;
    color: #666;
}

/* User Info */
.main-content .user-info {
    background: var(--surface-color, white);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-info p {
    margin: 0.5rem 0;
}

/* Spinning Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}