/* ============================================
   Archive Search Page - Enhanced Styles
   Modern, Beautiful, and Responsive Design
   ============================================ */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 5px 20px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 50px rgba(0,0,0,0.08);
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

/* ============================================
   Hero Section
   ============================================ */
.archive-hero {
    background: var(--primary-gradient);
    padding: 60px 0;
    margin-bottom: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.archive-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.archive-hero h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.6s ease;
}

.archive-hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

/* ============================================
   Search Card
   ============================================ */
.search-card {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    margin-bottom: 30px;
    border: none;
    transition: var(--transition);
    animation: fadeIn 0.8s ease;
}

.search-card:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}

.search-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #f0f0f0;
}

.search-header i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-left: 15px;
    animation: pulse 2s infinite;
}

.search-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 10px;
    display: block;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group label i {
    color: var(--primary-color);
    margin-left: 5px;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-light);
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
    outline: none;
    transform: translateY(-2px);
}

.form-control:hover {
    border-color: #cbd5e0;
}

/* ============================================
   Buttons
   ============================================ */
.btn-search {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    width: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-search::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-search:hover::before {
    width: 300px;
    height: 300px;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-search:active {
    transform: translateY(0);
}

.btn-reset {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-reset:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text-medium);
}

/* ============================================
   Advanced Options
   ============================================ */
.advanced-options {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 25px;
    border: 2px dashed var(--border-color);
    transition: var(--transition);
}

.advanced-options:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.advanced-options-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    user-select: none;
}

.advanced-options-header:hover {
    color: var(--secondary-color);
}

.advanced-options-header i {
    transition: transform 0.3s ease;
}

.advanced-options-header.collapsed i {
    transform: rotate(180deg);
}

#advancedContent {
    animation: slideDown 0.3s ease;
}

/* ============================================
   Results Section
   ============================================ */
.results-header {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    animation: fadeIn 0.5s ease;
}

.results-count {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 600;
}

.results-count span {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.results-count i {
    color: var(--primary-color);
    margin-left: 10px;
}

.results-info {
    color: var(--text-light);
}

/* ============================================
   Post Cards
   ============================================ */
.post-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-right: 5px solid transparent;
    animation: fadeInUp 0.5s ease;
    position: relative;
    overflow: hidden;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 0;
    background: var(--primary-gradient);
    transition: height 0.3s ease;
}

.post-card:hover::before {
    height: 100%;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(-5px);
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 5px 12px;
    background: var(--bg-light);
    border-radius: 20px;
    transition: var(--transition);
}

.post-meta-item:hover {
    background: #e6f2ff;
    transform: scale(1.05);
}

.post-meta-item i {
    color: var(--primary-color);
}

.post-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.6;
}

.post-card h4 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.post-card h4 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.post-card h4 a:hover::after {
    width: 100%;
}

.post-card h4 a:hover {
    color: var(--primary-color);
}

.post-summary {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
}

.post-image {
    width: 100%;
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.post-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* ============================================
   No Results / Empty State
   ============================================ */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.8s ease;
}

.no-results i {
    font-size: 5rem;
    color: #cbd5e0;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.no-results h3 {
    color: var(--text-medium);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.no-results p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ============================================
   Pagination
   ============================================ */
.pagination-wrapper {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-top: 30px;
    animation: fadeIn 0.6s ease;
}

.page-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-pagination li {
    margin: 0;
}

.page-pagination a, 
.page-pagination .btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-medium);
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

.page-pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.page-pagination .active-page a {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.page-pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb-custom {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.4s ease;
}

.breadcrumb-custom a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.breadcrumb-custom a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   Loading States
   ============================================ */
.btn-search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-search .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .archive-hero {
        padding: 40px 20px;
    }

    .archive-hero h1 {
        font-size: 1.8rem;
    }

    .archive-hero p {
        font-size: 1rem;
    }

    .search-card {
        padding: 25px;
    }

    .search-header h3 {
        font-size: 1.4rem;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .post-card {
        padding: 20px;
    }

    .post-card h4 {
        font-size: 1.2rem;
    }

    .post-image {
        max-width: 100%;
        height: 200px;
    }

    .page-pagination a,
    .page-pagination .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .archive-hero h1 {
        font-size: 1.5rem;
    }

    .search-card {
        padding: 20px;
    }

    .btn-search,
    .btn-reset {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .search-card,
    .pagination-wrapper,
    .btn-search,
    .btn-reset {
        display: none;
    }

    .post-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ============================================
   Accessibility Enhancements
   ============================================ */
.form-control:focus,
.btn-search:focus,
.btn-reset:focus,
.page-pagination a:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control,
    .btn-search,
    .btn-reset {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
