/* Events Page Styles */

.events-header {
    margin-top: 70px;
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(236, 122, 56, 0.1), rgba(255, 206, 58, 0.1));
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content h1 {
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    font-size: 24px;
    color: var(--light-text);
    font-weight: 300;
}

/* Add Event Section */
.add-event-section {
    padding: 40px 0;
    text-align: center;
}

.info-box {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(236, 122, 56, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
    animation: slideDown 0.3s ease;
}

.info-box i {
    font-size: 28px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.info-box p {
    margin: 0;
    color: var(--light-text);
    font-size: 15px;
    line-height: 1.6;
}

.info-box strong {
    color: var(--dark-text);
}

.info-box code {
    background: rgba(255, 0, 0, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Events Grid */
.events-section {
    padding: 60px 0;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Event Card */
.event-card {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(236, 122, 56, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease;
}

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

.event-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 0, 0, 0.2);
}

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.carousel-slide.placeholder {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.15), rgba(236, 122, 56, 0.15));
    font-size: 60px;
    color: rgba(255, 0, 0, 0.3);
}

/* Carousel Controls */
.carousel-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid white;
}

.carousel-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: var(--secondary-color);
}

/* Carousel Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 5;
    font-size: 18px;
    border-radius: 5px;
    transition: all 0.3s ease;
    opacity: 0;
}

.carousel-container:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* Event Info */
.event-info {
    padding: 20px;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.event-title h3 {
    font-size: 22px;
    color: var(--dark-text);
    margin-bottom: 5px;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--light-text);
}

.event-meta i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-delete-btn {
    background: rgba(255, 0, 0, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.event-delete-btn:hover {
    background: var(--primary-color);
    color: white;
}

.event-description {
    color: var(--light-text);
    font-size: 14px;
    line-height: 1.6;
    margin: 15px 0;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Expanded description when user clicks 'Leggi altro' */
.event-description.expanded {
    max-height: none;
    overflow: visible;
    text-overflow: unset;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

/* Read more button */
.read-more-btn {
    display: inline-block;
    margin-top: 8px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease, color 0.2s ease;
}

.read-more-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Media Count Badge */
.media-count {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 10px 0;
}

/* Empty State */
.empty-state {
    padding: 100px 20px;
    text-align: center;
    color: var(--light-text);
}

.empty-state i {
    font-size: 80px;
    color: rgba(255, 0, 0, 0.2);
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 32px;
    color: var(--dark-text);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: 1fr;
    }

    .header-content h1 {
        font-size: 36px;
    }

    .header-content p {
        font-size: 18px;
    }

    .carousel-container {
        height: 250px;
    }

    .carousel-btn {
        opacity: 0.7;
        padding: 8px 12px;
        font-size: 16px;
    }

    .form-buttons {
        flex-direction: column;
    }

    .form-buttons .btn {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .events-header {
        padding: 50px 15px;
    }

    .header-content h1 {
        font-size: 28px;
    }

    .carousel-container {
        height: 200px;
    }

    .event-title h3 {
        font-size: 18px;
    }

    .add-event-form {
        padding: 20px;
    }
}

/* Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.carousel-slide.active {
    animation: scaleIn 0.5s ease;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--light-text);
}

.loading i {
    font-size: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
