/* =================================================================
   WP Calendar Aggregator – Frontend Styles
   ================================================================= */

/* Wrap
   --------------------------------------------------------------- */
.wpca-calendar-wrap {
    max-width: 100%;
    margin: 1em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ---------------------------------------------------------------- */
/*  Toolbar                                                          */
/* ---------------------------------------------------------------- */
.wpca-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1em;
    padding: 8px 12px;
    background: #1d2327;
    border-radius: 6px;
    color: #fff;
}

.wpca-toolbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wpca-toolbar-nav .wpca-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.wpca-toolbar-nav .wpca-btn:hover {
    background: rgba(255,255,255,0.25);
}

.wpca-today-btn {
    font-size: 13px !important;
    font-weight: 600;
    padding: 6px 16px !important;
}

.wpca-current-label {
    margin-left: 12px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.wpca-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* View switcher */
.wpca-view-switcher {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.wpca-view-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.wpca-view-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.wpca-view-btn.active {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

.wpca-view-sep {
    color: rgba(255,255,255,0.3);
    padding: 0 2px;
}

.wpca-display-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    padding: 6px 10px;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.15s;
}
.wpca-display-btn:hover {
    color: #fff;
}
.wpca-display-btn.active {
    color: #00bfff;
}
.wpca-display-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* ---------------------------------------------------------------- */
/*  Inline Filters                                                   */
/* ---------------------------------------------------------------- */
.wpca-inline-filters {
    margin-bottom: 1em;
    padding: 12px 16px;
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
}

.wpca-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.wpca-filter-field {
    flex: 1 1 140px;
    min-width: 120px;
}

.wpca-filter-field label {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
}

.wpca-filter-field select,
.wpca-filter-field input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

.wpca-filter-keyword {
    flex: 2 1 180px;
}
.wpca-filter-location {
    flex: 2 1 180px;
}

.wpca-filter-actions {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    padding-bottom: 1px;
}

/* ---------------------------------------------------------------- */
/*  Buttons                                                          */
/* ---------------------------------------------------------------- */
.wpca-btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    color: #1d2327;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    transition: all 0.15s;
}
.wpca-btn:hover {
    background: #f0f0f0;
    border-color: #8c8f94;
}
.wpca-btn-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}
.wpca-btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

/* ---------------------------------------------------------------- */
/*  Loading                                                          */
/* ---------------------------------------------------------------- */
.wpca-loading {
    text-align: center;
    padding: 40px;
    color: #646970;
}
.wpca-loading .spinner {
    display: inline-block;
    float: none;
    margin-right: 8px;
    vertical-align: middle;
}

/* ---------------------------------------------------------------- */
/*  Month – calendar grid                                            */
/* ---------------------------------------------------------------- */
.wpca-calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    overflow: hidden;
}

.wpca-calendar-table th {
    padding: 10px 6px;
    text-align: center;
    background: #1d2327;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.wpca-calendar-table td {
    border: 1px solid #e0e0e0;
    padding: 4px;
    vertical-align: top;
    min-height: 80px;
    height: 90px;
    transition: background 0.15s;
    cursor: pointer;
}
.wpca-calendar-table td:hover {
    background: #f0f6fc;
}

.wpca-day-empty {
    background: #f9f9f9;
    cursor: default;
}

.wpca-day-number {
    display: inline-block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    padding: 2px 6px;
    border-radius: 50%;
    cursor: pointer;
}
.wpca-day-number:hover {
    background: #e0e0e0;
}

.wpca-today .wpca-day-number {
    background: #2271b1;
    color: #fff;
}
.wpca-today .wpca-day-number:hover {
    background: #135e96;
}

.wpca-has-events {
    background: #fffde7;
}

.wpca-day-events {
    font-size: 12px;
    line-height: 1.4;
}

.wpca-event-link {
    display: block;
    padding: 2px 6px;
    margin-bottom: 2px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s;
}
.wpca-event-link:hover {
    background: #135e96;
}

.wpca-more-events {
    display: block;
    color: #646970;
    font-style: italic;
    padding: 2px 6px;
    font-size: 11px;
}

/* ---------------------------------------------------------------- */
/*  Week – calendar grid                                             */
/* ---------------------------------------------------------------- */
.wpca-week-view {
    overflow-x: auto;
}

.wpca-week-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    overflow: hidden;
}

.wpca-week-table th {
    padding: 10px 6px;
    background: #1d2327;
    color: #fff;
    text-align: center;
    font-size: 13px;
}

.wpca-week-time-col {
    width: 60px;
    background: #f9f9f9;
    border-right: 1px solid #e0e0e0;
}

.wpca-week-day-col {
    border: 1px solid #e0e0e0;
    padding: 4px;
    vertical-align: top;
    min-height: 100px;
    height: 120px;
    cursor: pointer;
    transition: background 0.15s;
}
.wpca-week-day-col:hover {
    background: #f0f6fc;
}

.wpca-week-today {
    background: #fffde7 !important;
}

.wpca-week-day-name {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #646970;
}

.wpca-week-day-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}
.wpca-week-day-num:hover {
    color: #2271b1;
}

.wpca-week-event {
    margin-bottom: 3px;
    padding: 4px 8px;
    background: #f0f6fc;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.3;
}
.wpca-week-event a {
    color: #1d2327;
    text-decoration: none;
}
.wpca-week-event a:hover {
    color: #2271b1;
}

.wpca-week-event-time {
    font-weight: 600;
    color: #2271b1;
}

.wpca-week-no-events {
    color: #c3c4c7;
}

/* ---------------------------------------------------------------- */
/*  Year view                                                        */
/* ---------------------------------------------------------------- */
.wpca-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.wpca-month-block {
    padding: 20px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wpca-month-block:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wpca-month-has-events {
    border-left: 4px solid #2271b1;
}

.wpca-month-block h4 {
    margin: 0 0 4px;
    font-size: 16px;
}

.wpca-month-count {
    display: block;
    font-size: 13px;
    color: #646970;
    margin-bottom: 10px;
}

.wpca-month-link {
    font-size: 12px;
}

/* ---------------------------------------------------------------- */
/*  List view                                                        */
/* ---------------------------------------------------------------- */
.wpca-list-view {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
}

.wpca-list-heading {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
    font-size: 20px;
}

.wpca-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Event card */
.wpca-event-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}
.wpca-event-card:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.wpca-event-color-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.wpca-event-thumb {
    flex-shrink: 0;
    width: 180px;
}
.wpca-event-thumb img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.wpca-event-info {
    flex: 1;
    min-width: 0;
}

.wpca-event-title {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.3;
}
.wpca-event-title a {
    color: #1d2327;
    text-decoration: none;
}
.wpca-event-title a:hover {
    color: #2271b1;
}

.wpca-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #646970;
}
.wpca-event-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    vertical-align: middle;
    margin-right: 2px;
    color: #2271b1;
}

.wpca-event-categories,
.wpca-event-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.wpca-cat-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #e0e0e0;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
    color: #1d2327;
    transition: background 0.15s;
}
.wpca-cat-badge:hover {
    background: #2271b1;
    color: #fff;
}

.wpca-tag-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    font-size: 11px;
    color: #50575e;
}

/* ---------------------------------------------------------------- */
/*  Day view (detailed list for single day)                          */
/* ---------------------------------------------------------------- */
.wpca-day-view {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
}

/* ---------------------------------------------------------------- */
/*  Event Detail                                                     */
/* ---------------------------------------------------------------- */
.wpca-event-detail {
    max-width: 800px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 24px;
}

.wpca-event-detail-thumb {
    margin-bottom: 16px;
}
.wpca-event-detail-thumb img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.wpca-detail-dates {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #2271b1;
}

.wpca-event-detail-body {
    margin-bottom: 20px;
    line-height: 1.7;
}

.wpca-event-detail-meta p {
    margin: 6px 0;
}

.wpca-event-detail-tags {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* ---------------------------------------------------------------- */
/*  No events                                                        */
/* ---------------------------------------------------------------- */
.wpca-no-events {
    color: #646970;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* ---------------------------------------------------------------- */
/*  Help / documentation                                             */
/* ---------------------------------------------------------------- */
.wpca-calendar-help {
    margin-top: 1em;
}
.wpca-calendar-help summary {
    cursor: pointer;
    font-size: 13px;
    color: #646970;
}
.wpca-calendar-help summary:hover {
    color: #2271b1;
}
.wpca-help-content {
    margin-top: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
.wpca-help-content h4 {
    margin: 16px 0 8px;
    color: #1d2327;
}
.wpca-help-content h4:first-child {
    margin-top: 0;
}
.wpca-help-content ul {
    margin: 0;
    padding-left: 20px;
}
.wpca-help-content li {
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.5;
}
.wpca-help-content p {
    font-size: 14px;
    line-height: 1.5;
}
.wpca-help-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.wpca-help-content table th,
.wpca-help-content table td {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    text-align: left;
}
.wpca-help-content table th {
    background: #f9f9f9;
    font-weight: 600;
}
.wpca-help-content pre {
    background: #1d2327;
    color: #a7aaad;
    padding: 12px 16px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}
.wpca-help-content pre code {
    color: inherit;
}

/* ---------------------------------------------------------------- */
/*  Search form                                                      */
/* ---------------------------------------------------------------- */
.wpca-search-wrap {
    max-width: 800px;
    margin: 1em 0;
}
.wpca-search-form {
    display: grid;
    gap: 1em;
}
.wpca-search-field label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
}
.wpca-search-field input,
.wpca-search-field select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}
.wpca-search-actions {
    display: flex;
    gap: 8px;
}

/* ---------------------------------------------------------------- */
/*  Submit / Favorites (kept from original, minor cleanup)           */
/* ---------------------------------------------------------------- */
.wpca-submit-wrap,
.wpca-favorites-wrap {
    max-width: 800px;
    margin: 1em 0;
}

.wpca-submit-tabs,
.wpca-favorites-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1em;
    border-bottom: 2px solid #e0e0e0;
}

.wpca-tab-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #646970;
}
.wpca-tab-btn:hover { color: #2271b1; }
.wpca-tab-btn.active {
    border-bottom-color: #2271b1;
    color: #2271b1;
    font-weight: 600;
}

.wpca-tab-content { display: none; }
.wpca-tab-content.active { display: block; }

.wpca-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.wpca-form-field { flex: 1; }
.wpca-form-field.wpca-full { flex-basis: 100%; }
.wpca-form-field label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
}
.wpca-form-field input,
.wpca-form-field select,
.wpca-form-field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}
.wpca-form-field .required { color: #a00; }
.wpca-form-actions { margin-top: 12px; }

.wpca-favorites-terms,
.wpca-favorites-keywords {
    list-style: none;
    padding: 0;
    margin: 0;
}
.wpca-favorites-terms li,
.wpca-favorites-keywords li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}
.wpca-remove-fav {
    background: none;
    border: none;
    color: #a00;
    cursor: pointer;
    font-size: 18px;
}
.wpca-no-favorites { color: #646970; font-style: italic; }
.wpca-fav-count {
    display: inline-block;
    background: #e0e0e0;
    color: #1d2327;
    border-radius: 10px;
    padding: 0 8px;
    font-size: 12px;
    margin-left: 4px;
}
.wpca-fav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}
.wpca-fav-toggle:hover { border-color: #e74c3c; }
.wpca-fav-toggle.favorited {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}
.wpca-fav-icon { font-size: 16px; }

/* ---------------------------------------------------------------- */
/*  Responsive                                                       */
/* ---------------------------------------------------------------- */
@media (max-width: 960px) {
    .wpca-year-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .wpca-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .wpca-toolbar-nav { justify-content: center; }
    .wpca-toolbar-right { justify-content: center; }
    .wpca-current-label { margin-left: 0; text-align: center; }

    .wpca-filter-row { flex-direction: column; }
    .wpca-filter-field { flex-basis: 100%; }

    .wpca-calendar-table td { height: 60px; min-height: 50px; }

    .wpca-event-card { flex-direction: column; }
    .wpca-event-thumb { width: 100%; }

    .wpca-form-row { flex-direction: column; }

    .wpca-year-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .wpca-year-grid { grid-template-columns: 1fr; }
    .wpca-week-table { min-width: 500px; }
}
