/* DEMOGRAF CEDR - CSS Variables & Utilities Library */

/* ============================================
   CSS VARIABLES FOR EASY CUSTOMIZATION
   ============================================ */

:root {
    /* Colors */
    --primary-color: #003d99;
    --secondary-color: #0056b3;
    --tertiary-color: #004085;
    --accent-color: #ffd700;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --text-dark: #333;
    --text-light: #555;
    --text-muted: #666;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 10px 30px rgba(0, 0, 0, 0.2);
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-sm: 0.85rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.4rem;
    --font-size-2xl: 1.8rem;
    --font-size-3xl: 2.2rem;
    --line-height-tight: 1.4;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.8;
    
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-timing: ease-in-out;
    
    /* Z-index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 500;
    --z-modal: 1000;
    --z-tooltip: 1000;
    --z-popover: 1001;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Display Utilities */
.hidden { display: none !important; }
.visible { display: block !important; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-center { justify-content: center; align-items: center; }
.flex-between { justify-content: space-between; align-items: center; }
.flex-around { justify-content: space-around; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }

/* Sizing Utilities */
.w-full { width: 100%; }
.w-half { width: 50%; }
.h-full { height: 100%; }
.max-w-container { max-width: 1200px; margin-left: auto; margin-right: auto; }

/* Margin Utilities */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--spacing-sm); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mb-md { margin-bottom: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mb-xl { margin-bottom: var(--spacing-xl); }

/* Padding Utilities */
.p-0 { padding: 0; }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }
.px-sm { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.text-bold { font-weight: bold; }
.text-semibold { font-weight: 600; }
.text-normal { font-weight: 400; }
.text-light { font-weight: 300; }
.text-italic { font-style: italic; }
.text-underline { text-decoration: underline; }
.text-muted { color: var(--text-muted); }
.text-light-color { color: var(--text-light); }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }

/* Background Utilities */
.bg-light { background-color: var(--light-bg); }
.bg-primary { background-color: var(--primary-color); color: white; }
.bg-secondary { background-color: var(--secondary-color); color: white; }
.bg-white { background-color: white; }

/* Border Utilities */
.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-left { border-left: 4px solid var(--secondary-color); }
.border-primary { border-color: var(--primary-color); }
.border-secondary { border-color: var(--secondary-color); }
.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Opacity Utilities */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Cursor Utilities */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Overflow Utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Transform & Transition Utilities */
.transition { transition: all var(--transition-speed) var(--transition-timing); }
.transform-gpu { transform: translateZ(0); }

/* Animation Utilities */
@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideOut {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn var(--transition-speed) var(--transition-timing); }
.animate-slide-in { animation: slideIn var(--transition-speed) var(--transition-timing); }
.animate-pulse { animation: pulse 2s infinite; }

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Mobile First Responsive */
@media (max-width: 480px) {
    .sm\:hidden { display: none; }
    .sm\:block { display: block; }
    .sm\:w-full { width: 100%; }
}

@media (max-width: 768px) {
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:w-full { width: 100%; }
    .md\:text-center { text-align: center; }
    .md\:flex-column { flex-direction: column; }
}

@media (min-width: 1024px) {
    .lg\:flex { display: flex; }
    .lg\:w-half { width: 50%; }
    .lg\:hidden { display: none; }
}

/* ============================================
   COMPONENT MODIFIERS
   ============================================ */

/* Button Modifiers */
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn-disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* Card Modifiers */
.card-hover:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card-flat { box-shadow: none; border: 1px solid var(--border-color); }

/* Feature Card - for home page intro section */
.feature-card {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--tertiary-color) 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-speed) ease;
    text-align: center;
}

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

.feature-card h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Card Header - for research and journal cards */
.card-header-gradient {
    background: linear-gradient(135deg, #003d99 0%, #0056b3 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.card-header-gradient--research {
    background: linear-gradient(135deg, #003d99 0%, #0056b3 100%);
}

.card-header-gradient--journal {
    background: linear-gradient(135deg, #004085 0%, #003366 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-header-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.card-header-gradient .card-header-title,
.card-header-gradient--journal .card-header-title {
    font-weight: 700;
    color: white;
    margin: 0;
}

/* Placeholder for missing card images */
.card-placeholder {
    background: #e0e0e0;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-placeholder-text {
    color: #999;
    font-size: 0.95rem;
}

/* Empty state */
.empty-state {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-muted);
}

/* Nav card - for category/section navigation */
.nav-card {
    display: inline-block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

.nav-card-content {
    background: white;
    border: 2px solid var(--secondary-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.nav-card:hover .nav-card-content {
    box-shadow: 0 5px 15px rgba(0, 86, 179, 0.3);
    transform: translateY(-4px);
}

.nav-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.nav-card-content h3 {
    color: var(--secondary-color);
}

.nav-card-content p {
    margin: 0;
}

/* Certificate Card Header */
.card-header-gradient--certificate {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-header-gradient--certificate .card-header-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card-header-gradient--certificate .card-header-title {
    font-weight: 700;
    color: white;
    margin: 0;
}

/* Detail Image */
.detail-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: block;
}

/* Journal detail image - smaller aspect ratio */
.detail-image--journal {
    aspect-ratio: 3/4;
    max-width: 400px;
    margin: 0 auto;
}

/* News Images Gallery */
.news-images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
}

.news-images-gallery .detail-image {
    margin: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

/* Mobile responsive gallery */
@media (max-width: 768px) {
    .news-images-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .news-images-gallery .detail-image {
        aspect-ratio: 4/3;
    }
}

@media (max-width: 480px) {
    .news-images-gallery {
        gap: 0.75rem;
    }
    
    .news-images-gallery .detail-image {
        aspect-ratio: 1/1;
    }
}

/* Document Section */
.document-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.document-section h3 {
    margin-top: 0;
}

.document-section .btn {
    margin-top: 0.5rem;
}

/* Document Content */
.document-content {
    flex-grow: 1;
}

/* Badge Component */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--secondary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-primary { background-color: var(--primary-color); }
.badge-secondary { background-color: var(--secondary-color); }
.badge-danger { background-color: #dc3545; }
.badge-success { background-color: #28a745; }
.badge-warning { background-color: #ffc107; color: black; }
.badge-info { background-color: #17a2b8; }

/* Alert Component */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.alert-primary { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.alert-success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background-color: #fff3cd; color: #856404; border-color: #ffeeba; }

/* Loading State */
.loading { position: relative; pointer-events: none; opacity: 0.6; }
.loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}
/* -------- PAGINATION -------- */
.pagination-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    border: 1px solid #e0e0e0;
}

.pagination {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.pagination-item {
    display: flex;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.pagination-link:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.2);
}

.pagination-current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    cursor: default;
    font-weight: 600;
}

.pagination-current:hover {
    transform: none;
    box-shadow: none;
}

.pagination-item.disabled .pagination-link {
    color: #999;
    border-color: #ddd;
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.pagination-item.disabled .pagination-link:hover {
    background-color: #f5f5f5;
    color: #999;
    transform: none;
    box-shadow: none;
}

.pagination-item.active {
    margin: 0 0.25rem;
}

.pagination-info {
    font-size: 0.95rem;
    color: #666;
    text-align: center;
    padding: 0.75rem 1.5rem;
    background-color: rgba(0, 61, 153, 0.05);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.pagination-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-nav {
        padding: 1.5rem;
        gap: 1rem;
    }

    .pagination {
        gap: 0.35rem;
    }

    .pagination-link {
        min-width: 40px;
        min-height: 40px;
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .pagination-info {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 480px) {
    .pagination-nav {
        padding: 1rem;
        gap: 0.75rem;
    }

    .pagination {
        gap: 0.3rem;
    }

    .pagination-link {
        min-width: 36px;
        min-height: 36px;
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }

    .pagination-info {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }

    /* Hide page numbers on very small screens, show only arrows */
    .pagination-link:not(:has(i)) {
        display: none;
    }
}