:root {
    --primary-color: #0054A2;
    --secondary-color: #134074;
    --background-color: #f5f7fa;
    --card-background: #ffffff;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout Components */
.navbar {
    background-color: var(--card-background);
    box-shadow: var(--shadow-md);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

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

.nav-logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    margin-top: 80px;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    background: var(--card-background);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 1000px;
    width: 100%;
    padding: 40px;
    animation: slideIn 0.5s ease-out;
}

.footer {
    width: 100%;
    margin-top: auto;
    background-color: var(--primary-color, #0054A2);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Typography */
h1 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.subtitle {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Form Components */
.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(19, 64, 116, 0.05) 0%, rgba(0, 84, 162, 0.05) 100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(19, 64, 116, 0.1) 0%, rgba(0, 84, 162, 0.1) 100%);
    transform: translateY(-2px);
}

.upload-area.dragover {
    background: linear-gradient(135deg, rgba(19, 64, 116, 0.2) 0%, rgba(0, 84, 162, 0.2) 100%);
    border-color: var(--secondary-color);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-text {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input[type="file"] {
    display: none;
}

/* Button Components */
.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: 2px solid transparent;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Cards and Lists */
.tool-grid {
    max-width: 1200px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 0 1rem;
}

.tool-card {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: #F2F9FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}
/* Botón de caché en navegación */
.cache-btn {
    background: linear-gradient(135deg, #134074, #0054A2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    margin-left: 20px;
}

.cache-btn:hover {
    background: linear-gradient(135deg, #061856, #134074);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 52, 167, 0.3);
}

.cache-btn i {
    font-size: 12px;
}

/* Botón flotante */
.floating-cache-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.floating-cache-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Responsivo */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .container {
        margin: 1rem;
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .actions {
        flex-direction: column;
    }

    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .cache-btn span {
        display: none;
    }
    
    .cache-btn {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }

    .upload-area {
        padding: 20px;
    }

    .upload-icon {
        font-size: 2rem;
    }

    h1 {
        font-size: 1.75rem;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Controls */
textarea {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background: #f9fafb;
    transition: border-color 0.3s ease;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-right: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Messages */
.message {
    padding: 16px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    display: none;
    animation: slideDown 0.5s ease-out;
}

.message.show {
    display: block;
}

.success-message {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.warning-message {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

/* Loading States */
.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid rgba(19, 64, 116, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* File Info */
.file-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin: 15px 0;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.file-info.show {
    display: flex;
}

.file-name {
    color: var(--text-primary);
    font-weight: 600;
}

.remove-file {
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    padding: 4px;
}

.remove-file:hover {
    transform: scale(1.2);
}

/* Statistics */
.stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 20px;
    background: #f0f9ff;
    border-radius: var(--radius-md);
    border: 1px solid #bae6fd;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Actions */
.actions {
    text-align: center;
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .container {
        margin: 1rem;
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .actions {
        flex-direction: column;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cache-btn span {
        display: none;
    }
    
    .cache-btn {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }

    .upload-area {
        padding: 20px;
    }

    .upload-icon {
        font-size: 2rem;
    }

    h1 {
        font-size: 1.75rem;
    }
}