/* Event Cards Styles */
.event-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #2d3748;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: #4a5568;
}

.event-card .card-img-top {
    border-radius: 0;
    transition: transform 0.3s ease;
}

.event-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Featured Event Styles */
.featured-event {
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
    border: 2px solid #4a5568;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.featured-event:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border-color: #68d391;
}

/* Event Badges */
.event-badge {
    z-index: 2;
}

.event-badge .badge {
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.event-type-badge {
    z-index: 2;
}

.event-type-badge .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.event-status {
    z-index: 2;
}

.event-status .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Event Stats */
.event-stat {
    text-align: center;
}

.event-stat h6 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.event-stat small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Body Styling */
.event-card .card-body {
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
}

.event-card .card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.event-card .card-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* Badge Color Variations */
.bg-purple {
    background-color: #8b5cf6 !important;
}

.bg-purple:hover {
    background-color: #7c3aed !important;
}

/* Event Card Grid */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Container responsive adjustments */
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Row adjustments for better wrapping */
.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.row > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Ensure proper column behavior */
.col-lg-4,
.col-md-6 {
    flex: 0 0 auto;
    min-width: 0;
}

/* Bootstrap grid fixes for proper wrapping */
@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 767.98px) {
    .col-lg-4,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Featured Events responsive */
    .featured-events-section .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Better text wrapping for event titles */
.event-card .card-title {
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

/* Ensure cards don't exceed container width */
.event-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Force proper row wrapping */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

/* Ensure proper flex behavior */
[class*="col-"] {
    position: relative;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Featured Events specific styles - keep original layout */
.featured-events-section .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.featured-events-section .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.featured-events-section .event-card {
    height: auto;
    margin-bottom: 1.5rem;
}

/* All Events specific styles - use grid layout */
.all-events-section .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.all-events-section .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.all-events-section .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .event-card .card-title {
        font-size: 0.95rem;
        line-height: 1.2;
    }
    
    .event-card .card-text {
        font-size: 0.8rem;
    }
    
    .event-stat h6 {
        font-size: 0.85rem;
    }
    
    .event-stat small {
        font-size: 0.6rem;
    }
}

@media (max-width: 992px) {
    .event-card .card-title {
        font-size: 0.9rem;
    }
    
    .event-card .card-text {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .event-stat h6 {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .event-card .card-body {
        padding: 0.8rem;
    }
    
    .event-card .card-title {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .event-card .card-text {
        font-size: 0.7rem;
        margin-bottom: 0.8rem;
    }
    
    .event-stat h6 {
        font-size: 0.75rem;
    }
    
    .event-stat small {
        font-size: 0.55rem;
    }
    
    /* Уменьшаем отступы для мобильных */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 576px) {
    .event-card .card-body {
        padding: 0.6rem;
    }
    
    .event-card .card-title {
        font-size: 0.8rem;
    }
    
    .event-card .card-text {
        font-size: 0.65rem;
    }
    
    .event-stat h6 {
        font-size: 0.7rem;
    }
    
    .event-stat small {
        font-size: 0.5rem;
    }
    
    /* Убираем лишние отступы */
    .mb-4 {
        margin-bottom: 0.8rem !important;
    }
    
    /* Уменьшаем размеры бейджей */
    .event-type-badge .badge,
    .event-status .badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    /* Для очень маленьких экранов */
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .event-card .card-body {
        padding: 0.5rem;
    }
    
    .event-card .card-title {
        font-size: 0.75rem;
        line-height: 1.1;
    }
    
    .event-card .card-text {
        font-size: 0.6rem;
        line-height: 1.2;
    }
    
    .event-stat h6 {
        font-size: 0.65rem;
    }
    
    .event-stat small {
        font-size: 0.45rem;
    }
    
    /* Минимальные отступы */
    .mb-4 {
        margin-bottom: 0.6rem !important;
    }
    
    .mb-5 {
        margin-bottom: 1rem !important;
    }
    
    /* Компактные бейджи */
    .event-type-badge .badge,
    .event-status .badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.3rem;
    }
    
    /* Компактные кнопки */
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.6rem;
    }
}

/* Animation for loading */
.event-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for multiple cards */
.event-card:nth-child(1) { animation-delay: 0.1s; }
.event-card:nth-child(2) { animation-delay: 0.2s; }
.event-card:nth-child(3) { animation-delay: 0.3s; }
.event-card:nth-child(4) { animation-delay: 0.4s; }
.event-card:nth-child(5) { animation-delay: 0.5s; }
.event-card:nth-child(6) { animation-delay: 0.6s; }

/* Tab Styling */
.nav-pills .nav-link {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #a0aec0;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-pills .nav-link.active {
    background-color: #4299e1;
    border-color: #4299e1;
    color: #ffffff;
}

/* Alert Styling for Empty States */
.alert {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #a0aec0;
    border-radius: 8px;
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    border-color: rgba(66, 153, 225, 0.3);
    color: #90cdf4;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f6e05e;
}

.alert-secondary {
    background: rgba(160, 174, 192, 0.1);
    border-color: rgba(160, 174, 192, 0.3);
    color: #a0aec0;
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-outline-primary {
    border: 1px solid #4299e1;
    color: #4299e1;
    background: transparent;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #4299e1;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

/* Header Styling */
.display-4 {
    background: linear-gradient(135deg, #ffffff 0%, #a0aec0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.lead {
    color: #a0aec0 !important;
}

/* Section Headers */
h2.text-white {
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
}

h2.text-white::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border-radius: 2px;
}
