/* African Election Calendar Styles V2 - Tabbed */

.aec-calendar-v2 {
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    max-width: 1000px;
    margin: 0 auto;
}

/* Search Bar Styling */
.aec-search-container {
    position: relative;
    margin-bottom: 25px;
    max-width: 500px;
}

#aec-search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 15px;
    color: #1e293b;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

#aec-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.aec-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #94a3b8;
}

/* Tabs Styling */
.aec-year-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.aec-year-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.aec-year-tab {
    padding: 12px 25px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #64748b;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    flex: 0 0 auto; /* Prevent shrinking */
}

.aec-year-tab:hover {
    color: #2563eb;
}

.aec-year-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Synthetic tab shown while a search is active */
.aec-search-tab {
    cursor: default;
    font-size: 16px;
    letter-spacing: 0.02em;
}
.aec-search-tab::before {
    content: "🔍 ";
    margin-right: 4px;
}

.aec-year-content {
    animation: fadeIn 0.4s ease;
}

.aec-year-section {
    transition: opacity 0.3s ease;
}

/* Search results — countries clustered across all years */
.aec-search-results {
    margin-top: 16px;
}
.aec-search-empty {
    padding: 24px 16px;
    color: #5C5A55;
    font-style: italic;
    text-align: center;
}

.aec-country-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aec-country-row {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.aec-country-header {
    background: #f8fafc;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.aec-flag {
    width: 24px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.aec-country-name {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
}

.aec-elections-table {
    padding: 0;
}

.aec-election-row {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1fr;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.aec-election-row:last-child {
    border-bottom: none;
}

.aec-election-type {
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}

.aec-election-description {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #64748b;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    line-height: 1.5;
}

.aec-election-date {
    display: flex;
    flex-direction: column;
}

.aec-month {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
}

.aec-full-date {
    font-size: 13px;
    color: #64748b;
}

.aec-election-status {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981; /* Default to upcoming */
}

.aec-election-row.past .status-dot {
    background: #94a3b8;
}

.aec-election-row.past .aec-month {
    color: #94a3b8;
}

.aec-election-row.past {
    background-color: #fafafa;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 640px) {
    .aec-year-tab {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    .aec-election-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .aec-election-status {
        justify-self: start;
    }
}
