/* =========================================
   Agenda Manager - Public Styles
   Fully Responsive: Mobile, Tablet, Desktop
   ========================================= */

/* Container - Full Width Support */
.am-agenda-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

/* =========================================
   Day Tabs
   ========================================= */
.am-day-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 35px;
    border-bottom: 2px solid #000;
    padding: 20px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    -webkit-overflow-scrolling: touch;
    position: static;
    top: 0;
    z-index: 100;
    background: #fff;
}

.am-day-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.am-day-tab {
    padding: 12px 24px;
    background: #f5f5f5;
    cursor: pointer;
    font-weight: 700;
    border: 2px solid #000;
    text-transform: uppercase;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.am-day-tab:hover {
    background: #e8e8e8;
}

.am-day-tab.active {
    background: #000;
    color: #fff;
}

/* Tab Colors */
.am-day-tab[data-day="1"].active { background: #EA572B; border-color: #EA572B; }
.am-day-tab[data-day="2"].active { background: #0173BA; border-color: #0173BA; }
.am-day-tab[data-day="3"].active { background: #000357; border-color: #000357; }
.am-day-tab[data-day="4"].active { background: #1F0A83; border-color: #1F0A83; }

/* =========================================
   Agenda Timeline Style
   ========================================= */
.am-event-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    position: relative;
    background: #fff;
}

.am-time-col {
    padding: 25px 20px;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    border-right: 2px solid #000;
    position: relative;
    color: #000;
}

/* The dot on the timeline */
.am-time-col::before {
    content: '';
    position: absolute;
    right: -7px;
    top: 32px;
    width: 12px;
    height: 12px;
    background: #000;
    border-radius: 50%;
    z-index: 2;
}

.am-content-col {
    padding: 25px 40px;
    position: relative;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.am-content-col:hover {
    background: #fdf5f0;
}

/* =========================================
   Event Type Tag
   ========================================= */
.am-event-type {
    display: inline-block;
    padding: 3px 10px;
    background: #4ab3a2;
    color: #000;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 12px;
    border: 1px solid #000;
    letter-spacing: 0.03em;
}

/* =========================================
   Event Content
   ========================================= */
.am-event-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.25;
    color: #000;
}

.am-event-meta {
    font-size: 1rem;
    color: #444;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* =========================================
   Event Spacer for Gaps
   ========================================= */
.am-event-spacer {
    display: flex;
    align-items: center;
    margin-left: 130px;
    padding: 18px 40px;
    border-left: 2px solid #000;
    position: relative;
    background: #fafafa;
    min-height: 45px;
}

.am-event-spacer::before {
    content: 'Tempo libero / Networking';
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-style: italic;
}

/* =========================================
   Speakers in Agenda
   ========================================= */
.am-event-speakers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-top: 18px;
}

.am-event-speakers .sm-speaker-card {
    transition: transform 0.2s ease;
}

.am-event-speakers .sm-speaker-card:hover {
    transform: translateY(-2px);
}

/* Inline speaker style in agenda */
.am-event-speakers .sm-speaker-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #f8f8f8;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
}

.am-event-speakers .sm-speaker-image-wrapper {
    width: 32px;
    height: 32px;
    margin: 0;
}

.am-event-speakers .sm-speaker-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    color: #333;
}

/* =========================================
   Event Modal
   ========================================= */
#am-event-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#am-event-modal.active {
    display: flex;
}

.am-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
}

.am-modal-container {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 850px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 45px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    z-index: 1;
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
}

.am-modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    color: #888;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.am-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.am-modal-body h2,
.am-modal-title {
    margin-top: 0;
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    line-height: 1.25;
    margin-bottom: 15px;
}

.am-modal-time {
    font-weight: 700;
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
}

.am-modal-image {
    max-width: 100%;
    margin-bottom: 25px;
    border-radius: 10px;
}

.am-modal-long-desc {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #444;
}

body.am-modal-open {
    overflow: hidden;
}

/* =========================================
   TABLET / IPAD (768px - 1024px)
   ========================================= */
@media (max-width: 1024px) {
    .am-agenda-container {
        padding: 15px;
    }
    
    .am-event-row {
        grid-template-columns: 110px 1fr;
    }
    
    .am-time-col {
        padding: 20px 15px;
        font-size: 1.05rem;
    }
    
    .am-time-col::before {
        top: 27px;
    }
    
    .am-content-col {
        padding: 20px 30px;
    }
    
    .am-event-spacer {
        margin-left: 110px;
        padding: 15px 30px;
    }
    
    .am-event-title {
        font-size: 1.4rem;
    }
    
    .am-day-tab {
        padding: 10px 20px;
    }
    
    .am-modal-container {
        padding: 35px;
    }
    
    .am-modal-body h2,
    .am-modal-title {
        font-size: 1.8rem;
    }
}

/* =========================================
   SMALL TABLET / IPAD PORTRAIT (768px)
   ========================================= */
@media (max-width: 768px) {
    .am-agenda-container {
        padding: 12px;
    }
    
    .am-day-tabs {
        gap: 8px;
        margin-bottom: 25px;
        padding-bottom: 10px;
    }
    
    .am-day-tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .am-event-row {
        grid-template-columns: 90px 1fr;
    }
    
    .am-time-col {
        padding: 18px 12px;
        font-size: 0.95rem;
    }
    
    .am-time-col::before {
        width: 10px;
        height: 10px;
        right: -6px;
        top: 25px;
    }
    
    .am-content-col {
        padding: 18px 20px;
    }
    
    .am-event-title {
        font-size: 1.25rem;
    }
    
    .am-event-meta {
        font-size: 0.95rem;
    }
    
    .am-event-spacer {
        margin-left: 90px;
        padding: 12px 20px;
        min-height: 40px;
    }
    
    .am-event-spacer::before {
        font-size: 0.75rem;
    }
    
    .am-event-speakers {
        gap: 10px;
        margin-top: 15px;
    }
    
    .am-event-speakers .sm-speaker-card {
        padding: 5px 10px;
    }
    
    .am-event-speakers .sm-speaker-image-wrapper {
        width: 28px;
        height: 28px;
    }
    
    .am-event-speakers .sm-speaker-name {
        font-size: 0.85rem;
    }
    
    /* Modal adjustments */
    .am-modal-container {
        padding: 30px 25px;
    }
    
    .am-modal-body h2,
    .am-modal-title {
        font-size: 1.6rem;
    }
}

/* =========================================
   MOBILE PHONES (< 480px)
   ========================================= */
@media (max-width: 480px) {
    .am-agenda-container {
        padding: 10px;
    }
    
    /* Full width tabs on mobile */
    .am-day-tabs {
        gap: 6px;
        margin-bottom: 20px;
        border-bottom-width: 1px;
        padding-bottom: 8px;
        justify-content: flex-start;
    }
    
    .am-day-tab {
        padding: 8px 14px;
        font-size: 0.8rem;
        border-width: 1px;
    }
    
    /* Switch to stacked layout on mobile */
    .am-event-row {
        grid-template-columns: 1fr;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border-radius: 10px;
        overflow: hidden;
        border: 1px solid #eee;
    }
    
    .am-time-col {
        justify-content: flex-start;
        border-right: none;
        border-bottom: 1px solid #eee;
        background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
        padding: 12px 18px;
        font-size: 1rem;
    }
    
    .am-time-col::before {
        display: none;
    }
    
    .am-content-col {
        padding: 16px 18px;
        border-bottom: none;
    }
    
    .am-content-col:hover {
        background: #fefefe;
    }
    
    .am-event-type {
        font-size: 0.7rem;
        padding: 2px 8px;
        margin-bottom: 10px;
    }
    
    .am-event-title {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }
    
    .am-event-meta {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    /* Spacer on mobile */
    .am-event-spacer {
        margin-left: 0;
        border-left: none;
        padding: 12px 18px;
        background: transparent;
        text-align: center;
        border-top: 1px dashed #ddd;
        border-bottom: 1px dashed #ddd;
        margin: 8px 0;
        min-height: auto;
    }
    
    .am-event-spacer::before {
        font-size: 0.75rem;
    }
    
    /* Speakers on mobile */
    .am-event-speakers {
        gap: 8px;
        margin-top: 12px;
    }
    
    .am-event-speakers .sm-speaker-card {
        padding: 4px 10px;
        gap: 8px;
    }
    
    .am-event-speakers .sm-speaker-image-wrapper {
        width: 26px;
        height: 26px;
    }
    
    .am-event-speakers .sm-speaker-name {
        font-size: 0.8rem;
    }
    
    /* Modal on mobile */
    #am-event-modal {
        padding: 10px;
    }
    
    .am-modal-container {
        padding: 25px 18px;
        border-radius: 12px;
        max-height: calc(100vh - 20px);
    }
    
    .am-modal-close {
        top: 12px;
        right: 14px;
        font-size: 28px;
        width: 36px;
        height: 36px;
    }
    
    .am-modal-body h2,
    .am-modal-title {
        font-size: 1.4rem;
        margin-bottom: 12px;
        padding-right: 30px;
    }
    
    .am-modal-time {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .am-modal-long-desc {
        font-size: 0.95rem;
    }
}

/* =========================================
   VERY SMALL PHONES (< 360px)
   ========================================= */
@media (max-width: 360px) {
    .am-day-tab {
        padding: 7px 12px;
        font-size: 0.75rem;
    }
    
    .am-time-col {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    .am-content-col {
        padding: 14px 15px;
    }
    
    .am-event-title {
        font-size: 1.05rem;
    }
    
    .am-event-meta {
        font-size: 0.85rem;
    }
    
    .am-modal-container {
        padding: 20px 15px;
    }
    
    .am-modal-body h2,
    .am-modal-title {
        font-size: 1.25rem;
    }
}

/* =========================================
   LARGE DESKTOP (> 1400px)
   ========================================= */
@media (min-width: 1400px) {
    .am-agenda-container {
        max-width: 1400px;
        padding: 30px 40px;
    }
    
    .am-event-row {
        grid-template-columns: 150px 1fr;
    }
    
    .am-time-col {
        padding: 28px 25px;
        font-size: 1.2rem;
    }
    
    .am-time-col::before {
        top: 35px;
        width: 14px;
        height: 14px;
        right: -8px;
    }
    
    .am-content-col {
        padding: 28px 50px;
    }
    
    .am-event-spacer {
        margin-left: 150px;
        padding: 20px 50px;
    }
    
    .am-event-title {
        font-size: 1.7rem;
    }
    
    .am-day-tab {
        padding: 14px 30px;
        font-size: 0.95rem;
    }
}

/* =========================================
   Utility & Accessibility
   ========================================= */
.am-content-col:focus,
.am-day-tab:focus {
    outline: 2px solid #4ab3a2;
    outline-offset: 2px;
}

/* Smooth scrolling for modal content */
.am-modal-container {
    scroll-behavior: smooth;
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .am-content-col:hover {
        background: #fff;
    }
    
    .am-content-col:active {
        background: #fdf5f0;
    }
    
    .am-day-tab:hover {
        background: #f5f5f5;
    }
    
    .am-day-tab:active {
        background: #e8e8e8;
    }
}

/* Prevent text selection on clickable elements */
.am-day-tab,
.am-content-col {
    -webkit-user-select: none;
    user-select: none;
}

/* WordPress Admin Bar Offset */
.admin-bar .am-day-tabs {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .am-day-tabs {
        top: 46px;
    }
}

/* Hide content for non-active days */
.am-day-content {
    animation: fadeIn 0.3s ease;
    padding: 20px 0 60px;
}

/* Day Tinting */
#am-day-1 {
    background: linear-gradient(90deg, rgba(234, 87, 43, 0) 0%, rgba(234, 87, 43, 0.06) 10%, rgba(234, 87, 43, 0.06) 90%, rgba(234, 87, 43, 0) 100%);
}
#am-day-2 {
    background: linear-gradient(90deg, rgba(1, 115, 186, 0) 0%, rgba(1, 115, 186, 0.06) 10%, rgba(1, 115, 186, 0.06) 90%, rgba(1, 115, 186, 0) 100%);
}
#am-day-3 {
    background: linear-gradient(90deg, rgba(0, 3, 87, 0) 0%, rgba(0, 3, 87, 0.06) 10%, rgba(0, 3, 87, 0.06) 90%, rgba(0, 3, 87, 0) 100%);
}
#am-day-4 {
    background: linear-gradient(90deg, rgba(31, 10, 131, 0) 0%, rgba(31, 10, 131, 0.06) 10%, rgba(31, 10, 131, 0.06) 90%, rgba(31, 10, 131, 0) 100%);
}

#am-day-1 .am-time-col { border-right-color: #EA572B; color: #EA572B; }
#am-day-1 .am-time-col::before { background: #EA572B; }
#am-day-1 .am-event-type { background: #EA572B; color: #fff; }

#am-day-2 .am-time-col { border-right-color: #0173BA; color: #0173BA; }
#am-day-2 .am-time-col::before { background: #0173BA; }
#am-day-2 .am-event-type { background: #0173BA; color: #fff; }

#am-day-3 .am-time-col { border-right-color: #000357; color: #000357; }
#am-day-3 .am-time-col::before { background: #000357; }
#am-day-3 .am-event-type { background: #000357; color: #fff; }

#am-day-4 .am-time-col { border-right-color: #1F0A83; color: #1F0A83; }
#am-day-4 .am-time-col::before { background: #1F0A83; }
#am-day-4 .am-event-type { background: #1F0A83; color: #fff; }

/* Adjust row background to be transparent to show day tint */
.am-event-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    position: relative;
    background: transparent;
}

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