/**
 * UNA Community Events Form Theme
 * Matches UNA brand guidelines from theme.json
 * Enhanced for block themes without traditional header.php
 */

/* ============================================================================
   VARIABLES - Match theme.json colors
   ============================================================================ */
:root {
    --una-primary: #472783;      /* UNA Purple */
    --una-secondary: #feb92b;     /* UNA Gold */
    --una-base: #ffffff;
    --una-contrast: #000000;
    --una-tertiary: #F6F6F6;
    --una-content-width: 650px;
    --una-wide-width: 1200px;
}

/* ============================================================================
   BODY & PAGE WRAPPER - Create consistent layout
   ============================================================================ */
body.una-community-events {
    background: var(--una-base);
    margin: 0;
    padding: 0;
}

.una-community-events .tribe-events-community-container {
    margin-top: 2rem;
}

/* ============================================================================
   GENERAL FORM CONTAINER
   ============================================================================ */
.tribe-events-community-container {
    max-width: var(--una-wide-width);
    margin: 2rem auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--una-contrast);
    background: var(--una-base);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Page Title */
.tribe-events-community h1,
.tribe-events-community-edit h1 {
    font-size: 3rem;
    line-height: 1.2;
    font-weight: 400;
    margin-bottom: 1.5rem;
    margin-top: 0;
    color: var(--una-contrast);
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--una-primary);
}

/* Section Headings */
.tribe-events-community h2,
.tribe-section-header h3 {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--una-contrast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   FORM SECTIONS
   ============================================================================ */
.tribe-section {
    background: var(--una-base);
    border: 1px solid #ddd;
    border-radius: 0;
    margin-bottom: 2rem;
    padding: 0;
    overflow: hidden;
}

.tribe-section-header {
    background: var(--una-primary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
}

.tribe-section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--una-tertiary) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tribe-section-content {
    padding: 1.5rem;
}

.tribe-section-content-description {
    margin-bottom: 1rem;
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

/* ============================================================================
   FORM FIELDS - Match UNA styling
   ============================================================================ */
.tribe-events-community label,
.tribe-section-content-label label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--una-contrast);
}

.tribe-events-community input[type="text"],
.tribe-events-community input[type="email"],
.tribe-events-community input[type="url"],
.tribe-events-community input[type="date"],
.tribe-events-community input[type="time"],
.tribe-events-community input[type="number"],
.tribe-events-community select,
.tribe-events-community textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--una-contrast);
    background: var(--una-base);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tribe-events-community input[type="text"]:focus,
.tribe-events-community input[type="email"]:focus,
.tribe-events-community input[type="url"]:focus,
.tribe-events-community input[type="date"]:focus,
.tribe-events-community input[type="time"]:focus,
.tribe-events-community input[type="number"]:focus,
.tribe-events-community select:focus,
.tribe-events-community textarea:focus {
    outline: none;
    border-color: var(--una-primary);
    box-shadow: 0 0 0 3px rgba(71, 39, 131, 0.1);
}

.tribe-events-community textarea {
    min-height: 150px;
    resize: vertical;
}

/* Field descriptions */
.tribe-events-community .description,
.tribe-events-community .tribe-field-description {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

/* Required field indicator */
.tribe-events-community .required {
    color: #d63638;
    font-weight: 700;
}

/* ============================================================================
   CHECKBOXES & RADIO BUTTONS
   ============================================================================ */
.tribe-events-community input[type="checkbox"],
.tribe-events-community input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.tribe-events-community label.tribe-events-community-checkbox-label {
    display: inline-flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
}

/* ============================================================================
   BUTTONS - Match UNA brand
   ============================================================================ */

.tribe_community_edit .button,
.tribe_community_edit .tribe-add-recurrence.tribe-button,
.tribe_community_edit .tribe-button
{
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: var(--una-primary) !important;
    color: var(--una-base) !important;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tribe-events-community button,
.tribe-events-community input[type="submit"],
.tribe-events-community .tribe-button,
.tribe-events-community .tribe-events-button,
.tribe-events-community .button {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: var(--una-primary) !important;
    color: var(--una-base) !important;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tribe-events-community button:hover,
.tribe-events-community input[type="submit"]:hover,
.tribe-events-community .tribe-button:hover,
.tribe-events-community .tribe-events-button:hover,
.tribe-events-community .button:hover {
    background: var(--una-contrast);
    color: var(--una-base);
}

.tribe-events-community button:active,
.tribe-events-community input[type="submit"]:active,
.tribe-events-community .tribe-button:active,
.tribe-events-community .tribe-events-button:active {
    background: var(--una-secondary);
    color: var(--una-base);
}

.tribe-events-community button:focus,
.tribe-events-community input[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(71, 39, 131, 0.3);
}

/* Secondary buttons */
.tribe-events-community .tribe-button-secondary {
    background: var(--una-tertiary);
    color: var(--una-contrast);
}

.tribe-events-community .tribe-button-secondary:hover {
    background: #ddd;
}

/* Delete/Remove buttons */
.tribe-events-community .tribe-button-delete,
.tribe-events-community .tribe-button-remove {
    background: #d63638;
    color: var(--una-base);
}

.tribe-events-community .tribe-button-delete:hover,
.tribe-events-community .tribe-button-remove:hover {
    background: #b32d2e;
}

/* View Submitted Events button in top right */
.tribe-events-community .tribe-events-button {
    float: right;
    margin-bottom: 1rem;
}

/* ============================================================================
   CALENDAR DIGEST SECTION - Custom styling for our template
   ============================================================================ */
.tribe-section-digest-dates {
    background: var(--una-base);
    border: 3px solid var(--una-primary);
    box-shadow: 0 4px 12px rgba(71, 39, 131, 0.1);
}

.tribe-section-digest-dates .tribe-section-header {
    background: var(--una-primary);
    color: var(--una-base);
    border-bottom: none;
}

.tribe-section-digest-dates .tribe-section-header h3 {
    color: var(--una-base);
}

/* Digest inclusion toggle */
.ecn-digest-inclusion-toggle {
    background: #f0e6ff;
    border: 2px solid var(--una-primary);
    border-radius: 0;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ecn-digest-inclusion-toggle label {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    margin: 0;
}

.ecn-digest-inclusion-toggle input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    cursor: pointer;
}

/* Date picker inputs */
.ecn-digest-date-input {
    border: 2px solid var(--una-primary) !important;
    padding: 0.75rem !important;
}

.ecn-digest-date-input:hover {
    background-color: var(--una-tertiary) !important;
    border-color: var(--una-contrast) !important;
}

.ecn-digest-date-input:focus {
    border-color: var(--una-primary) !important;
    box-shadow: 0 0 0 3px rgba(71, 39, 131, 0.2) !important;
}

/* Calendar dropdown */
.ecn-calendar {
    border: 2px solid var(--una-primary);
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(71, 39, 131, 0.15);
}

.ecn-calendar-header {
    border-bottom: 2px solid var(--una-primary);
}

.ecn-calendar-nav {
    color: var(--una-primary);
}

.ecn-calendar-nav:hover {
    background: var(--una-tertiary);
}

.ecn-calendar-day.available {
    background: #f0e6ff;
    color: var(--una-contrast);
}

.ecn-calendar-day.available:hover {
    background: #e0d0ff;
    border-color: var(--una-primary);
}

.ecn-calendar-day.selected {
    background: var(--una-primary);
    color: var(--una-base);
    border-color: var(--una-primary);
}

.ecn-calendar-day.other-selected {
    background: #ffe0e0 !important;
    color: #999 !important;
}

/* Audience selection */
.ecn-audience-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.ecn-audience-option {
    border: 2px solid #ddd;
    border-radius: 0;
    padding: 1rem;
    transition: all 0.2s ease;
}

.ecn-audience-option:hover {
    border-color: var(--una-primary);
    background: var(--una-tertiary);
}

.ecn-audience-option:has(input:checked) {
    border-color: var(--una-primary);
    background: #f0e6ff;
    box-shadow: 0 0 0 2px rgba(71, 39, 131, 0.1);
}

.ecn-audience-option input[type="radio"]:checked + span {
    color: var(--una-primary);
    font-weight: 700;
}

/* ============================================================================
   FORM TABLE LAYOUT
   ============================================================================ */
.tribe-section-content table {
    width: 100%;
    border-collapse: collapse;
}

.tribe-section-content-row {
    border-bottom: 1px solid #f0f0f0;
}

.tribe-section-content-label {
    width: 30%;
    padding: 1rem 1rem 1rem 0;
    vertical-align: top;
    font-weight: 700;
}

.tribe-section-content-field {
    padding: 1rem 0;
}

/* ============================================================================
   VALIDATION & ERROR MESSAGES
   ============================================================================ */
.tribe-events-community .tribe-errors,
.tribe-events-community .tribe-validation-error {
    background: #ffebe9;
    border-left: 4px solid #d63638;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #b32d2e;
}

.tribe-events-community .tribe-errors ul {
    margin: 0;
    padding-left: 1.5rem;
}

.tribe-events-community .tribe-errors li {
    margin-bottom: 0.5rem;
}

.tribe-events-community .tribe-field-error input,
.tribe-events-community .tribe-field-error select,
.tribe-events-community .tribe-field-error textarea {
    border-color: #d63638;
}

/* Success messages */
.tribe-events-community .tribe-success,
.tribe-events-community .tribe-notice-success {
    background: #d5f5e3;
    border-left: 4px solid #46b450;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #0f5132;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media screen and (max-width: 782px) {
    body.admin-bar.una-community-events::before {
        top: 46px;
    }
    
    body.admin-bar.una-community-events::after {
        top: 61px;
    }
}

@media screen and (max-width: 768px) {
    body.una-community-events::after {
        width: 180px;
        height: 36px;
        left: 20px;
    }
    
    .tribe-events-community-container {
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .tribe-events-community h1 {
        font-size: 2rem;
    }
    
    .tribe-events-community h2,
    .tribe-section-header h3 {
        font-size: 1.25rem;
    }
    
    .tribe-section-content table {
        display: block;
    }
    
    .tribe-section-content-row {
        display: block;
        margin-bottom: 1rem;
    }
    
    .tribe-section-content-label,
    .tribe-section-content-field {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .ecn-audience-options {
        grid-template-columns: 1fr;
    }
    
    .tribe-events-community .tribe-events-button {
        float: none;
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 1.5rem;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.tribe-events-community .tribe-hidden {
    display: none !important;
}

.tribe-events-community .tribe-clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Loading state */
.tribe-events-community .tribe-loading {
    opacity: 0.6;
    pointer-events: none;
}

#footer p {
    font-size: .5em !important;
    padding: 0 1em 1em;
    text-align: right;
}

/*HIDING THE RESPONSIVE CONTAINER BLOCKING NAVIGATION*/
@media screen and (max-width: 600px) {
    .wp-block-navigation__responsive-container:not(.is-menu-open) {
        pointer-events: none !important;
        visibility: hidden !important;
    }
}