/* ===================================
   PubAct Plugin - Main Styles
   Compatible with Divi 5
   =================================== */

/* Reset and Base Styles */
.pubact-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #2d3436;
}

/* Yearly Section Container */
.pubact-yearly-section {
    display: block;
    margin: 30px 0;
    padding: 20px 0;
}

.pubact-year-title {
    color: rgb(14, 102, 140) !important;
    text-align: left;
    font-size: 2.875rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

.pubact-divider {
    border: none;
    border-top: 2px solid rgba(14, 102, 140, 0.1);
    margin: 20px 0;
    height: 0;
}

/* Row and Column Layouts */
.pubact-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 20px 0;
    width: 100%;
}

.pubact-column {
    display: flex;
    flex-direction: column;
}

/* Event/Acta Items */
.pubact-item-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.pubact-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(14, 102, 140, 0.15);
    border-color: rgba(14, 102, 140, 0.3);
}

.pubact-item-card-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.pubact-item-image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pubact-item-image img {
    max-width: 80px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.pubact-item-text {
    flex: 1;
    min-width: 0;
}

.pubact-item-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #2d3436;
}

.pubact-item-title a {
    color: rgb(14, 102, 140);
    text-decoration: none;
    transition: color 0.3s ease;
}

.pubact-item-title a:hover {
    color: #0a4275;
    text-decoration: underline;
}

.pubact-description {
    font-size: 0.95rem;
    color: #555555;
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
}

.pubact-description p {
    margin: 0;
}

/* Calendar Premium Styles */
.pubact-calendar-premium {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 800px;
    margin: 20px auto;
    font-family: 'Inter', -apple-system, sans-serif;
    color: #2d3436;
}

.pubact-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.pubact-calendar-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: rgb(14, 102, 140);
    text-transform: capitalize;
    margin: 0;
}

.pubact-nav-link {
    text-decoration: none;
    font-size: 1.5rem;
    color: rgb(14, 102, 140);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: rgba(14, 102, 140, 0.1);
    border: none;
    cursor: pointer;
}

.pubact-nav-link:hover {
    background: rgb(14, 102, 140);
    color: white;
    transform: scale(1.1);
}

.pubact-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.pubact-day-name {
    text-align: center;
    font-weight: 700;
    color: #b2bec3;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding-bottom: 15px;
}

.pubact-day {
    aspect-ratio: 1;
    background: #f9f9f9;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: default;
}

.pubact-day.empty {
    background: transparent;
}

.pubact-day:not(.empty):hover {
    transform: translateY(-5px);
    background: #ffffff;
    box-shadow: 0 8px 15px rgba(14, 102, 140, 0.1);
}

.pubact-day.is-today {
    border: 2px solid rgb(14, 102, 140);
    font-weight: 600;
}

.pubact-day.has-events {
    background: rgba(14, 102, 140, 0.1);
    cursor: pointer;
}

.pubact-day.has-events:hover {
    background: rgb(14, 102, 140);
    color: white;
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
}

.event-dots {
    display: flex;
    gap: 3px;
    margin-top: 5px;
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-evento {
    background: rgb(14, 102, 140);
}

.dot-acta {
    background: #ff7675;
}

.pubact-day.has-events:hover .event-dot {
    background: white;
}

.pubact-event-list-popup {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #2d3436;
    color: white;
    padding: 12px;
    border-radius: 10px;
    width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.pubact-day.has-events:hover .pubact-event-list-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.pubact-popup-item {
    border-bottom: 1px solid #454d4f;
    padding: 5px 0;
    font-size: 0.85rem;
    text-align: left;
}

.pubact-popup-item:last-child {
    border: none;
}

.pubact-popup-item strong {
    display: block;
}

.pubact-popup-item small {
    color: #a29bfe;
}

/* Event Cards Container */
.pubact-event-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0;
    font-family: 'Inter', -apple-system, sans-serif;
}

.pubact-event-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #f0f0f0;
    position: relative;
}

.pubact-event-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(14, 102, 140, 0.15);
    border-color: rgb(14, 102, 140);
}

.pubact-event-date-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgb(14, 102, 140);
    color: white;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    box-shadow: 0 5px 15px rgba(14, 102, 140, 0.3);
}

.pubact-badge-day {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.pubact-badge-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2px;
}

.pubact-event-content {
    padding: 30px;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pubact-event-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 15px 0;
    padding-right: 60px;
    line-height: 1.2;
}

.pubact-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #636e72;
}

.pubact-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pubact-event-description {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.pubact-event-button {
    display: inline-block;
    background: rgba(14, 102, 140, 0.1);
    color: rgb(14, 102, 140);
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.pubact-event-button:hover {
    background: rgb(14, 102, 140);
    color: white;
}

.pubact-no-events {
    text-align: center;
    padding: 50px;
    background: #f9f9f9;
    border-radius: 20px;
    color: #b2bec3;
}

.pubact-no-events-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Load More Button Styles */
.pubact-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin: 50px 0 30px 0;
}

.pubact-load-more-btn {
    background: rgb(14, 102, 140);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(14, 102, 140, 0.25);
    position: relative;
    overflow: hidden;
}

.pubact-load-more-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(14, 102, 140, 0.4);
    background: #0a4275;
}

.pubact-load-more-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.pubact-load-more-btn:disabled,
.pubact-load-more-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.pubact-load-more-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: pubact-spin 0.8s linear infinite;
}

@keyframes pubact-spin {
    to {
        transform: rotate(360deg);
    }
}

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

    .pubact-year-title {
        font-size: 2rem !important;
    }

    .pubact-event-cards-container {
        grid-template-columns: 1fr;
    }

    .pubact-calendar-premium {
        padding: 15px;
    }

    .pubact-calendar-grid {
        gap: 5px;
    }

    .day-number {
        font-size: 0.9rem;
    }

    .pubact-item-card-content {
        flex-direction: column;
        align-items: center;
    }

    .pubact-item-text {
        text-align: center;
    }

    .pubact-load-more-btn {
        padding: 12px 30px;
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .pubact-event-cards-container {
        grid-template-columns: 1fr;
    }

    .pubact-item-card {
        padding: 15px;
    }

    .pubact-calendar-premium {
        padding: 10px;
    }

    .pubact-calendar-title {
        font-size: 1.3rem;
    }

    .pubact-calendar-grid {
        gap: 3px;
    }

    .pubact-load-more-btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .pubact-load-more-btn.loading::after {
        width: 14px;
        height: 14px;
        margin-top: -7px;
        border-width: 2px;
    }
}
