/* Events Plugin Styles */

/* Загальні стилі */
.school-events-shortcode,
.events-archive,
.single-event {
    font-family: inherit;
}

/* Компоненти кнопок */
.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #3498db;
    color: white;
    text-decoration: none;
}

/* Card компоненти */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Badge компоненти */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 15px;
}

.badge-primary {
    background: #e8f4fd;
    color: #2980b9;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-secondary {
    background: #e9ecef;
    color: #6c757d;
}

/* Іконки */
.icon {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.icon-sm {
    width: 0.875em;
    height: 0.875em;
}

.icon-lg {
    width: 1.25em;
    height: 1.25em;
}

/* Мета-інформація */
.meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.meta-item .icon {
    color: #3498db;
    flex-shrink: 0;
}

/* Дати та час */
.date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: white;
    border-radius: 12px;
    padding: 1rem;
    min-width: 70px;
    position: absolute;
    top: 1rem;
    right: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.date-badge.past {
    background: #95a5a6;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.4);
}

.date-badge-day {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.date-badge-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Завантажувач */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f2f5;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Порожній стан */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Фільтри */
.filters-container {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Сітка подій */
.events-container {
    display: grid;
    gap: 2rem;
}

.events-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.events-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.events-masonry {
    column-count: auto;
    column-width: 300px;
    column-gap: 2rem;
}

/* Картка події */
.event-card {
    break-inside: avoid;
    margin-bottom: 2rem;
}

.event-thumbnail {
    position: relative;
    overflow: hidden;
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-card:hover .event-image {
    transform: scale(1.05);
}

.event-content {
    padding: 1.5rem;
}

.event-header {
    margin-bottom: 1rem;
}

.event-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.event-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.event-title a:hover {
    color: #3498db;
}

.event-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f2f5;
    gap: 1rem;
}

.event-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.read-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.read-more:hover {
    color: #2980b9;
    text-decoration: none;
}

.read-more .icon {
    transition: transform 0.3s ease;
}

.read-more:hover .icon {
    transform: translateX(3px);
}

/* Список виглядів для фільтрів */
.view-toggle {
    display: flex;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    padding: 0.75rem;
    background: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.view-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.view-btn.active {
    background: #3498db;
    color: white;
}

/* Пагінація */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #e9ecef;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-btn:hover {
    background: #3498db;
    border-color: #3498db;
    color: white;
    text-decoration: none;
}

.pagination-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background: white;
    border-color: #e9ecef;
    color: #666;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    color: #666;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs-separator {
    color: #999;
}

/* Адаптивність */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .events-container {
        gap: 1.5rem;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .events-masonry {
        column-count: 1;
    }
    
    .event-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination-btn {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .date-badge {
        position: static;
        margin-bottom: 1rem;
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .card-body,
    .event-content {
        padding: 1rem;
    }
    
    .event-title {
        font-size: 1.1rem;
    }
    
    .event-excerpt {
        font-size: 0.9rem;
    }
    
    .filters-container {
        gap: 0.75rem;
    }
    
    .filter-select {
        font-size: 13px;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
        border: 4px solid #3498db;
        border-radius: 50%;
    }
}

/* Focus styles */
*:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.btn-primary:focus,
.btn-secondary:focus,
.filter-select:focus,
.view-btn:focus {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .event-title a:hover {
        text-decoration: underline;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
    
    .btn-secondary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}

/* Print styles */
@media print {
    .filters-container,
    .view-toggle,
    .pagination,
    .btn-primary,
    .btn-secondary,
    .read-more {
        display: none !important;
    }
    
    .event-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .event-title a {
        color: #000 !important;
        text-decoration: none;
    }
    
    .event-title a:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}