/**
 * E-Journals Page Styles
 * Comprehensive styling for electronic journals collection page
 */

/* CSS Custom Properties for E-Journals Theme */
:root {
    --ej-primary: #3498db;
    --ej-primary-dark: #2980b9;
    --ej-secondary: #34495e;
    --ej-accent: #e74c3c;
    --ej-success: #27ae60;
    --ej-warning: #f39c12;
    --ej-info: #17a2b8;
    --ej-light: #ecf0f1;
    --ej-dark: #2c3e50;
    --ej-gradient: linear-gradient(135deg, var(--ej-primary) 0%, var(--ej-primary-dark) 100%);
    --ej-shadow: 0 4px 15px rgba(52, 152, 219, 0.15);
    --ej-shadow-hover: 0 8px 25px rgba(52, 152, 219, 0.25);
    --ej-border-radius: 12px;
    --ej-transition: all 0.3s ease;
}

/* Page Hero Section */
.page-hero {
    position: relative;
    height: 60vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: 180px; /* Account for fixed header */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ej-gradient);
    opacity: 0.8;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-content .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
    border: none;
}

.hero-content .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: rgba(255, 255, 255, 0.8);
}

.hero-content .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--ej-transition);
}

.hero-content .breadcrumb-item a:hover {
    color: white;
}

.hero-content .breadcrumb-item.active {
    color: white;
}

/* Statistics Section */
.stats-section {
    background: var(--ej-gradient);
    position: relative;
    overflow: hidden;
}

.stats-section::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"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.stat-item {
    text-align: center;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filter Section */
.filter-section {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.search-box .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px 0 0 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: var(--ej-transition);
}

.search-box .form-control:focus {
    border-color: var(--ej-primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.search-box .btn {
    border-radius: 0 8px 8px 0;
    border: 2px solid var(--ej-primary);
    padding: 12px 20px;
}

.form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: var(--ej-transition);
}

.form-select:focus {
    border-color: var(--ej-primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Category Tabs */
.category-tabs {
    margin-bottom: 3rem;
}

.category-tabs .nav-pills .nav-link {
    background: white;
    border: 2px solid #e9ecef;
    color: var(--ej-secondary);
    padding: 12px 24px;
    margin: 0 8px;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--ej-transition);
    box-shadow: var(--ej-shadow);
}

.category-tabs .nav-pills .nav-link:hover {
    border-color: var(--ej-primary);
    color: var(--ej-primary);
    transform: translateY(-2px);
    box-shadow: var(--ej-shadow-hover);
}

.category-tabs .nav-pills .nav-link.active {
    background: var(--ej-gradient);
    border-color: var(--ej-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--ej-shadow-hover);
}

/* Section Headers */
.section-header {
    margin-bottom: 3rem;
}

.section-title {
    color: var(--ej-dark);
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--ej-gradient);
    border-radius: 2px;
}

.section-description {
    color: var(--ej-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Journal Cards */
.journal-card {
    background: white;
    border-radius: var(--ej-border-radius);
    box-shadow: var(--ej-shadow);
    transition: var(--ej-transition);
    overflow: hidden;
    height: 100%;
    border: 1px solid #f8f9fa;
}

.journal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--ej-shadow-hover);
}

.journal-header {
    padding: 24px;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.journal-cover {
    width: 60px;
    height: 60px;
    background: var(--ej-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.journal-info h4 {
    margin: 0 0 12px 0;
    color: var(--ej-dark);
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1.4;
}

.journal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.journal-meta span {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.journal-meta .publisher {
    background: var(--ej-light);
    color: var(--ej-dark);
}

.journal-meta .issn {
    background: #e8f4fd;
    color: var(--ej-primary);
}

.journal-meta .access-type {
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

.journal-meta .access-type.open {
    background: #d4edda;
    color: #155724;
}

.journal-meta .access-type.subscription {
    background: #fff3cd;
    color: #856404;
}

.journal-content {
    padding: 24px;
}

.journal-description {
    color: var(--ej-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.journal-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.journal-subjects span {
    background: #f8f9fa;
    color: var(--ej-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
    transition: var(--ej-transition);
}

.journal-subjects span:hover {
    background: var(--ej-primary);
    color: white;
    border-color: var(--ej-primary);
}

.journal-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.journal-stats .stat {
    text-align: center;
}

.journal-stats .stat strong {
    display: block;
    font-size: 1.4rem;
    color: var(--ej-primary);
    font-weight: 700;
}

.journal-stats .stat span {
    font-size: 0.8rem;
    color: var(--ej-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-actions {
    display: flex;
    gap: 12px;
}

.journal-actions .btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--ej-transition);
}

.journal-actions .btn-primary {
    background: var(--ej-gradient);
    border: none;
}

.journal-actions .btn-outline-primary {
    border-color: var(--ej-primary);
    color: var(--ej-primary);
}

.journal-actions .btn-outline-primary:hover {
    background: var(--ej-primary);
    border-color: var(--ej-primary);
}

/* Publishers Grid */
.publishers-grid {
    margin-bottom: 3rem;
}

.publisher-item {
    background: white;
    border-radius: var(--ej-border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--ej-shadow);
    transition: var(--ej-transition);
    cursor: pointer;
    border: 1px solid #f8f9fa;
    height: 100%;
}

.publisher-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--ej-shadow-hover);
    border-color: var(--ej-primary);
}

.publisher-logo {
    width: 50px;
    height: 50px;
    background: var(--ej-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: white;
    font-size: 1.2rem;
}

.publisher-item h6 {
    margin: 0 0 8px 0;
    color: var(--ej-dark);
    font-weight: 600;
}

.publisher-item span {
    color: var(--ej-secondary);
    font-size: 0.85rem;
}

/* Subject Areas */
.subject-areas {
    margin-top: 3rem;
}

.subject-card {
    background: white;
    border-radius: var(--ej-border-radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--ej-shadow);
    transition: var(--ej-transition);
    border: 1px solid #f8f9fa;
    height: 100%;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ej-shadow-hover);
}

.subject-icon {
    width: 60px;
    height: 60px;
    background: var(--ej-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 1.5rem;
}

.subject-card h5 {
    color: var(--ej-dark);
    font-weight: 600;
    margin-bottom: 12px;
}

.subject-card p {
    color: var(--ej-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Open Access Features */
.open-access-features {
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    border-radius: var(--ej-border-radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--ej-shadow);
    transition: var(--ej-transition);
    border: 1px solid #f8f9fa;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ej-shadow-hover);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--ej-success) 0%, #229954 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 1.5rem;
}

.feature-card h5 {
    color: var(--ej-dark);
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--ej-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Directory Links */
.directory-links {
    margin-top: 2rem;
}

.directory-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.directory-card {
    background: white;
    border-radius: var(--ej-border-radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--ej-shadow);
    transition: var(--ej-transition);
    border: 1px solid #f8f9fa;
    height: 100%;
}

.directory-link:hover .directory-card {
    transform: translateY(-3px);
    box-shadow: var(--ej-shadow-hover);
    border-color: var(--ej-primary);
}

.directory-icon {
    width: 50px;
    height: 50px;
    background: var(--ej-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 1.2rem;
}

.directory-card h6 {
    color: var(--ej-dark);
    font-weight: 600;
    margin-bottom: 12px;
}

.directory-card p {
    color: var(--ej-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Show More Button */
#showMoreNSBM {
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--ej-transition);
}

#showMoreNSBM:hover {
    transform: translateY(-2px);
    box-shadow: var(--ej-shadow-hover);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-hero {
        height: 50vh;
        min-height: 400px;
    }
    
    .hero-content .display-4 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .journal-header {
        flex-direction: column;
        text-align: center;
    }
    
    .journal-cover {
        margin: 0 auto;
    }
    
    .journal-stats {
        flex-direction: column;
        gap: 16px;
    }
    
    .journal-actions {
        flex-direction: column;
    }
    
    .category-tabs .nav-pills .nav-link {
        margin: 4px;
        padding: 10px 16px;
    }
    
    .filter-section .row > div {
        margin-bottom: 12px;
    }
}

@media (max-width: 576px) {
    .hero-content .display-4 {
        font-size: 1.75rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .journal-card {
        margin-bottom: 20px;
    }
    
    .publisher-item {
        margin-bottom: 16px;
    }
    
    .stats-section .row > div {
        margin-bottom: 20px;
    }
}

/* Print Styles */
@media print {
    .page-hero,
    .filter-section,
    .category-tabs,
    .journal-actions,
    #showMoreNSBM {
        display: none !important;
    }
    
    .journal-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .journal-card {
        border: 2px solid var(--ej-dark);
    }
    
    .category-tabs .nav-pills .nav-link {
        border: 2px solid var(--ej-dark);
    }
    
    .feature-card,
    .subject-card,
    .directory-card,
    .publisher-item {
        border: 2px solid var(--ej-dark);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .journal-card:hover,
    .publisher-item:hover,
    .subject-card:hover,
    .feature-card:hover,
    .directory-card:hover {
        transform: none;
    }
}

/* Focus Styles for Accessibility */
.journal-card:focus-within,
.publisher-item:focus-within,
.subject-card:focus-within,
.feature-card:focus-within,
.directory-card:focus-within {
    outline: 2px solid var(--ej-primary);
    outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--ej-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ej-primary-dark);
}
