/* =========================================
   Examarth - Modern Exams Page CSS
   ========================================= */

/* Search Input */
.exam-search {
    width: 100%;
    max-width: 500px;
    padding: 0.875rem 1.25rem;
    margin: 1.5rem auto 2rem;
    display: block;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.exam-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.6rem 1.25rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.filter-btn .count {
    opacity: 0.8;
    font-size: 0.85em;
    margin-left: 0.25rem;
}

/* Exams Grid - Strict Column Control */
.exams-grid {
    display: grid;
    /* Default for mobile: 1 column */
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 3rem;
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .exams-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

/* Small Laptop: 3 columns */
@media (min-width: 1024px) {
    .exams-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* Desktop: 4 columns (User Requested) */
@media (min-width: 1280px) {
    .exams-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* Exam Card - Modern Design */
.exam-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1), 
                0 0 0 1px rgba(79, 70, 229, 0.1);
}

.exam-card:hover::before {
    opacity: 1;
}

/* Card Header */
.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.exam-category-badge {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    color: #0369a1;
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Badges */
.exam-status {
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    background: linear-gradient(135deg, #dcfce7, #d1fae5);
    color: #166534;
}

.status-upcoming {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.status-closed {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.status-completed {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

/* Card Content */
.exam-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.exam-conducting-body {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

/* Exam Details */
.exam-details {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
}

.exam-detail-item {
    display: flex;
    gap: 0.75rem;
    align-items: start;
}

.detail-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.detail-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.9rem;
    color: #0f172a;
    font-weight: 600;
}

.exam-description {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Card Actions */
.exam-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    flex-wrap: wrap; /* Allow wrapping on small cards */
}

.btn-view-details {
    flex: 1;
    padding: 0.6rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-view-details:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f8fafc;
    transform: translateY(-1px);
}

.btn-apply {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn-apply:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .exams-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .exam-card {
        padding: 1.5rem;
    }
    
    .exam-title {
        font-size: 1.1rem;
    }
    
    .filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .exam-actions {
        flex-direction: column;
    }
    
    .exam-search {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
}
