/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00798C;
    --primary-dark: #005A6B;
    --primary-light: #0099B0;
    --secondary-color: #FF6B35;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --background-light: #F8F9FA;
    --white: #FFFFFF;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
}

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

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.logo-svg {
    height: 40px;
    width: auto;
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.breadcrumb {
    color: var(--text-light);
    font-size: 0.9rem;
}

.stats-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    margin-left: 1rem;
}

.stats-link:hover {
    background: var(--background-light);
    color: var(--primary-dark);
}

/* Hero Section */
.hero {
    background-image: url('img/FRONTEND.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    color: var(--white);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 121, 140, 0.4);
    backdrop-filter: blur(0px);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(1px);
    padding: 2rem 3rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 1;
    max-width: 600px;
    margin: 0 auto;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    font-weight: 400;
}

.hero-subtitle strong {
    color: #ffffff !important;
    font-weight: 600;
}

/* Main Content */
.main {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* Category Tabs */
.categories {
    margin-bottom: 3rem;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--white);
    border: 2px solid #E9ECEF;
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.document-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

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

.document-preview {
    height: 200px;
    background: linear-gradient(135deg, #F8F9FA, #E9ECEF);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.document-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="20" y="20" width="60" height="80" fill="none" stroke="%2300798C" stroke-width="2" rx="4"/><path d="M20 30h60M20 40h40M20 50h50M20 60h35" fill="none" stroke="%2300798C" stroke-width="1"/></svg>');
    opacity: 0.1;
}

.document-icon {
    font-size: 3rem;
    color: var(--primary-color);
    z-index: 2;
}

.document-info {
    padding: 1.5rem;
}

.document-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.document-category {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.document-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.document-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: var(--background-light);
    border: none;
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.action-btn.primary:hover {
    background: var(--primary-dark);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E9ECEF;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #E9ECEF;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--background-light);
    color: var(--text-dark);
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--background-light);
    border-bottom: 1px solid #E9ECEF;
    gap: 1rem;
}

.control-btn {
    background: var(--white);
    border: 1px solid #E9ECEF;
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

.page-info {
    font-weight: 500;
    color: var(--text-dark);
}

.pdf-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: auto;
}

#pdfCanvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: var(--shadow);
    border-radius: 8px;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        min-height: 300px;
        padding: 2rem 0;
    }
    
    .hero-content {
        padding: 1.5rem 2rem;
        margin: 0 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .category-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    
    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .pdf-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .control-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
        min-height: 250px;
    }
    
    .hero-content {
        padding: 1rem 1.5rem;
        margin: 0 0.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .logo-svg {
        height: 35px;
    }
    
    .main {
        padding: 2rem 0;
    }
    
    .document-info {
        padding: 1rem;
    }
    
    .pdf-container {
        padding: 1rem;
    }
}
