/**
 * Events Calendar Custom Styles
 * File: events/css/events.css
 * Description: CSS cho custom event list và các component liên quan
 * 
 * ==========================================================================
 * COLOR CUSTOMIZATION GUIDE
 * ==========================================================================
 * 
 * To change the primary color (currently #041052):
 * 1. Update --event-primary-color in :root
 * 2. Generate new icon filter at: https://codepen.io/sosuke/pen/Pjoqqp
 * 3. Update --event-icon-filter with the generated filter
 * 
 * Example for blue (#0066cc):
 * --event-primary-color: #0066cc;
 * --event-icon-filter: invert(27%) sepia(96%) saturate(1332%) hue-rotate(200deg) brightness(99%) contrast(101%);
 * 
 * ==========================================================================
 */

/* ========================================================================
   CSS Variables - Color Configuration
   ======================================================================== */
:root {
    /* Primary Brand Color - Used for title, time, date, venue */
    --event-primary-color: #041052;
    
    /* Secondary Colors */
    --event-secondary-color: #666;        /* Text content, excerpt */
    --event-light-color: #999;            /* Light text, labels */
    
    /* Background Colors */
    --event-bg-color: #fff;               /* Event box background */
    --event-hover-color: #f8f9fa;         /* Hover states */
    
    /* Border Colors */
    --event-border-color: #e9ecef;        /* Borders, avatars */
    
    /* Icon Filters - Auto-generated for primary color #041052 */
    --event-icon-filter: invert(6%) sepia(100%) saturate(6589%) hue-rotate(244deg) brightness(82%) contrast(150%);
}

/* ========================================================================
   Event List Styles
   ======================================================================== */

.event-list {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.event-link:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-2px);
}

.event-box {
    display: flex;
    gap: 25px;
    margin-bottom: 5`px;
    background: var(--event-bg-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}
.event-box:hover{
	background: #f5f5f5;
}
.event-link:hover .event-box {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================================================
   Event Thumbnail
   ======================================================================== */

.event-thumb {
    flex: 0 0 220px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 220px; /* Square: 220px × 220px (1:1 aspect ratio) */
}

.event-thumb img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}


/* ========================================================================
   Event Info
   ======================================================================== */

.event-info {
    flex: 1;
    position: relative;
    margin-right: 30px; /* Gap rộng hơn giữa cột 2 và 3 trên desktop */
	display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-title {
    margin-top: 0;
    font-size: 18px;
    color: var(--event-primary-color);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 10px;
}

.event-meta-time-venue {
    font-size: 16px;
    font-weight: 400;
    color: var(--event-primary-color);
    margin-top: 8px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Event Meta Items */
.event-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.event-meta-item:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.event-box:hover .event-title{
	color: #cd421f;
}

.event-meta-icon {
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    flex-shrink: 0;
    filter: var(--event-icon-filter);
    transition: filter 0.2s ease;
}

.event-meta-text {
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
    line-height: 1.3;
}

/* Icon Backgrounds */
.event-time .event-meta-icon {
    background-image: url('../icons/time-fill.svg');
}

.event-date .event-meta-icon {
    background-image: url('../icons/calendar-fill.svg');
}

.event-venue .event-meta-icon {
    background-image: url('../icons/map-pin-3-fill.svg');
}

.event-excerpt {
    font-size: 14px;
    margin: 10px 0;
    line-height: 1.6;
    color: var(--event-secondary-color);
}

.event-speakers-label {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
    font-weight: 500;
}

.event-speakers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ========================================================================
   Event Organizers - Desktop 3-cột layout
   ======================================================================== */

.event-organizer {
    flex: 0 0 160px;
}

.event-organizer-label {
    font-size: 15px;
    color: #333333;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
}

.event-organizer .event-hosts-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Desktop hosts trong event-info (ẩn trên desktop) */
.event-info .event-hosts {
    display: none;
}

/* Host Items - Chỉ hiển thị logo với tooltip */
.organizer-item.host-item {
    display: inline-block;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.organizer-item.host-item:hover {
    background-color: #f8f9fa;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Speaker Items - Hiển thị ngang: hình + tên */
.organizer-item.speaker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    text-align: left;
    padding: 0 20px 0 0;
    border-radius: 130px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    width: fit-content;
    /* max-width: 220px; */
}

.organizer-item.speaker-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Host Avatar - Hình chữ nhật ngang */
.organizer-avatar.host-avatar {
    width: 120px;
    height: 60px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #e9ecef;
    transition: border-color 0.3s ease;
    background: #fff;
}

.organizer-item.host-item:hover .organizer-avatar.host-avatar {
    border-color: #007cba;
}

/* Speaker Avatar - Nhỏ hơn */
.organizer-avatar.speaker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
    flex-shrink: 0;
}

.organizer-avatar-placeholder.host-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    text-transform: uppercase;
}

.organizer-avatar-placeholder.speaker-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

/* Host Name - Ẩn, chỉ dùng tooltip */
.organizer-name.host-name {
    display: none;
}

/* Speaker Name - Hiển thị bên cạnh avatar */
.organizer-name.speaker-name {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category - Ẩn cho hosts, hiển thị nhỏ cho speakers */
.organizer-category.host-category {
    display: none;
}

.organizer-category.speaker-category {
    font-size: 8px;
    color: #999;
    font-style: italic;
    margin-left: auto;
    opacity: 0.7;
}

.organizer-category.no-category {
    color: #999;
}

/* ========================================================================
   Tooltip Styles for Hosts
   ======================================================================== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    
    /* Position */
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    
    /* Fade effect */
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Speaker List Styling */
.event-speakers-list {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-wrap: wrap;
}

/* ========================================================================
   Empty States
   ======================================================================== */

.no-organizers {
    font-size: 11px;
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

.no-events {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* ========================================================================
   Responsive Design
   ======================================================================== */

/* Tablet Layout - Gộp thành 2 cột */
@media (max-width: 1024px) and (min-width: 769px) {
    .event-box {
        gap: 20px;
    }
    
    .event-thumb {
        flex: 0 0 180px;
        height: 180px; /* Square: 180px × 180px (1:1 aspect ratio) */
    }
    
    .event-info {
        margin-right: 0; /* Bỏ margin-right */
    }
    
    /* Ẩn cột organizer riêng */
    .event-organizer {
        display: none;
    }
    
    /* Hiển thị hosts trong event-info */
    .event-info .event-hosts {
        display: block !important;
        margin-top: 15px;
    }
    
    .event-info .event-hosts .event-organizer-label {
        font-size: 12px;
        color: #777;
        margin-bottom: 8px;
        font-weight: 500;
        text-align: left;
    }
    
    .event-info .event-hosts-list {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        align-items: flex-start;
        flex-direction: row !important;
    }
    
    /* Host images responsive trên tablet */
    .organizer-avatar.host-avatar {
        width: 100px;
        height: 50px;
    }
    
    .organizer-avatar-placeholder.host-avatar {
        font-size: 18px;
    }
}

/* Mobile Layout - 1 cột */
@media (max-width: 768px) {
    .event-link:hover {
        transform: none; /* Bỏ transform trên mobile */
    }
    
    .event-box {
        flex-direction: column;
        gap: 15px;
    }
    
    .event-link:hover .event-box {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); /* Shadow nhẹ hơn trên mobile */
    }
    
    .event-thumb {
        flex: none;
        max-width: 100%;
        height: 280px; /* Square aspect ratio on mobile */
        width: 280px;
        margin: 0 auto; /* Center the square image */
    }
    
    .event-thumb img {
        height: 100%;
        object-fit: cover;
    }
    
    .event-info {
        margin-right: 0;
    }
    
    /* Ẩn cột organizer riêng */
    .event-organizer {
        display: none;
    }
    
    /* Hiển thị hosts trong event-info */
    .event-info .event-hosts {
        display: block !important;
        margin-top: 15px;
    }
    
    .event-info .event-hosts .event-organizer-label {
        font-size: 12px;
        color: #777;
        margin-bottom: 8px;
        font-weight: 500;
        text-align: left;
    }
    
    .event-info .event-hosts-list {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
        align-items: flex-start;
        flex-direction: row !important;
    }
    
    /* Host images responsive trên mobile */
    .organizer-avatar.host-avatar {
        width: 80px;
        height: 40px;
    }
    
    .organizer-avatar-placeholder.host-avatar {
        font-size: 16px;
    }
    
    /* Speakers layout trên mobile */
    .event-speakers-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }
    
    .organizer-item.speaker-item {
        flex: 0 1 auto;
        min-width: 140px;
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .event-box {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .event-thumb {
        height: 250px; /* Square but smaller on very small screens */
        width: 250px;
    }
    
    .event-title {
        font-size: 16px;
    }
    
    .event-excerpt {
        font-size: 13px;
    }
    
    /* Mobile Event Meta */
    .event-meta-time-venue {
        font-size: 14px;
        gap: 12px;
    }
    
    .event-meta-icon {
        width: 16px;
        height: 16px;
    }
    
    /* Host images nhỏ nhất trên mobile */
    .organizer-avatar.host-avatar {
        width: 65px;
        height: 35px;
    }
    
    .organizer-avatar-placeholder.host-avatar {
        font-size: 14px;
    }
    
    /* Speaker avatars trên mobile */
    .organizer-avatar.speaker-avatar {
        width: 30px;
        height: 30px;
    }

    .organizer-item.speaker-item {
        min-width: 120px;
        max-width: 160px;
        padding: 5px 10px;
    }

    .organizer-name.speaker-name {
        font-size: 12px;
    }
    
    .tooltip .tooltiptext {
        width: 100px;
        margin-left: -50px;
        font-size: 10px;
    }
}

/* ========================================================================
   Utility Classes
   ======================================================================== */

.event-debug {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    margin: 10px 0;
}

.event-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.event-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}
