/* Article Card Components */
.article-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

/* Search highlighting styles */
.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-highlight:hover {
    background-color: #ffeaa7;
    color: #6c5ce7;
}

/* Search Results Section Styles */
.search-results-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px solid #2196f3;
    margin-bottom: 2rem;
    overflow: hidden;
}

.search-results-header {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1976d2;
}

.search-results-header h3 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.search-results-header .search-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.search-result-item {
    background: white;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    margin: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.2);
    border-color: #2196f3;
}

.search-result-item .result-header {
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    border-bottom: 1px solid #f8f9fa;
}

.search-result-item .result-content {
    padding: 0.5rem 1.5rem 1rem 1.5rem;
}

.search-result-item .revija-info {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.search-result-item .article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.search-result-item .article-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-result-item .article-title a:hover {
    color: #e67e22;
}

.search-result-item .article-excerpt {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.search-result-item .result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid #f8f9fa;
}

.search-result-item .view-article-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.search-result-item .view-article-btn:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.search-result-item .view-revija-btn {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.search-result-item .view-revija-btn:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
}

/* Year section toggle styles */
.year-header {
    transition: all 0.3s ease;
    user-select: none;
}

.year-header:hover {
    background-color: rgba(13, 110, 253, 0.05);
    border-radius: 6px;
    padding: 0.5rem;
    margin: -0.5rem;
}

.year-toggle-icon {
    transition: transform 0.3s ease, color 0.3s ease;
    color: #6c757d;
}

.year-header:hover .year-toggle-icon {
    color: #0d6efd;
}

.year-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 2000px; /* Large enough to accommodate content */
    opacity: 1;
    transform: translateY(0);
}

.year-content.collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.year-toggle-icon.rotated {
    transform: rotate(180deg);
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.article-card .card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.article-card .card-body {
    padding: 1rem 1.5rem;
}

.article-card .card-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.article-card .card-title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.article-card .card-title a {
    transition: color 0.3s ease;
}

.article-card .card-title a:hover {
    color: #0056b3 !important;
}

/* Article content styling */
.article-content-preview {
    position: relative;
}

.article-preview {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.article-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.article-full {
    max-height: none;
    overflow: visible;
}

/* Toggle button styling */
.toggle-content {
    transition: all 0.3s ease;
    border-radius: 20px;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

.toggle-content:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.toggle-content.expanded {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.toggle-content.expanded:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Badge styling */
.article-card .badge {
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Date styling */
.article-card .text-muted {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .article-card .card-title {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }
    
    .article-card .card-header {
        padding: 1rem 1rem 0 1rem;
    }
    
    .article-card .card-body {
        padding: 0.75rem 1rem;
    }
    
    .article-card .card-footer {
        padding: 0 1rem 1rem 1rem;
    }
    
    .article-card .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
    
    .article-card .d-flex {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch !important;
    }
    
    .article-card .d-flex .btn {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .article-card .text-muted {
        font-size: 0.8rem;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    /* Mobile-specific content adjustments */
    .article-preview {
        max-height: 150px;
    }
    
    .article-preview::after {
        height: 30px;
    }
    
    /* Better touch targets */
    .toggle-content {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 576px) {
    .article-card .card-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .article-card .card-header,
    .article-card .card-body,
    .article-card .card-footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .article-card .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .article-preview {
        max-height: 120px;
    }
    
    .article-preview::after {
        height: 25px;
    }
}

/* Mobile hero section optimization */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Mobile table of contents */
@media (max-width: 768px) {
    .list-unstyled li {
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        background-color: #f8f9fa;
        border-radius: 6px;
    }
    
    .list-unstyled li strong {
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }
    
    .list-unstyled li a {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Revija Card Styles for Archive */
.revija-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.revija-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
    border-color: #007bff;
}

.revija-card .card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.revija-card .card-body {
    padding: 1rem 1.5rem;
}

.revija-card .card-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    background-color: #f8f9fa;
}

.revija-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #007bff;
}

.revija-articles ul {
    margin: 0;
    padding: 0;
}

.revija-articles li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.revija-articles li:last-child {
    border-bottom: none;
}

.revija-articles a {
    color: #495057;
    transition: color 0.3s ease;
}

.revija-articles a:hover {
    color: #007bff;
}

/* Archive search card */
.search-filter-card {
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.search-filter-card .card-body {
    padding: 2rem;
}

/* Mobile responsive for revija cards */
@media (max-width: 768px) {
    .revija-card .card-header,
    .revija-card .card-body,
    .revija-card .card-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .revija-card .card-title {
        font-size: 1.1rem;
    }
    
    .search-filter-card .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .revija-card .card-header,
    .revija-card .card-body,
    .revija-card .card-footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .revija-card .card-title {
        font-size: 1rem;
    }
    
    .search-filter-card .card-body {
        padding: 1rem;
    }
}

/* Animation for content expansion */
.article-content-preview {
    transition: all 0.3s ease;
}

.article-preview,
.article-full {
    transition: all 0.3s ease;
}

/* Smooth expand/collapse animation */
.article-full.expanding {
    animation: expandContent 0.3s ease-out;
}

.article-preview.collapsing {
    animation: collapseContent 0.3s ease-out;
}

@keyframes expandContent {
    from {
        max-height: 200px;
        opacity: 0.7;
    }
    to {
        max-height: none;
        opacity: 1;
    }
}

@keyframes collapseContent {
    from {
        max-height: none;
        opacity: 1;
    }
    to {
        max-height: 200px;
        opacity: 0.7;
    }
}
