/* ── ETM Portal Styles ── */
.etm-portal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1e293b;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    line-height: 1.6;
}
.etm-portal *, .etm-portal *::before, .etm-portal *::after {
    box-sizing: border-box;
}

/* ── Fullpage body ── */
.etm-fullpage-body {
    margin: 0;
    background: #f8fafc;
}
.etm-fullpage-wrapper {
    min-height: 100vh;
}

/* ── Nav ── */
.etm-portal-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.etm-portal-brand {
    font-size: 18px;
    font-weight: 700;
    color: #6366f1;
}
.etm-portal .etm-portal-nav ul,
.etm-portal-nav ul {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px;
    flex-wrap: wrap;
}
.etm-portal .etm-portal-nav li,
.etm-portal-nav li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.etm-portal .etm-portal-nav li a,
.etm-portal-nav li a {
    display: block;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none !important;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.etm-portal-nav li a:hover {
    background: #f1f5f9;
    color: #6366f1;
}
.etm-portal-nav li.active a {
    background: #6366f1;
    color: #fff;
}

/* ── User account in nav ── */
.etm-portal-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.etm-user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background .15s;
}
.etm-user-link:hover,
.etm-user-link.etm-user-active {
    background: #f1f5f9;
}
.etm-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.etm-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.etm-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.etm-user-phone {
    font-size: 11px;
    color: #94a3b8;
}
.etm-logout-link {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.etm-logout-link:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Buttons ── */
.etm-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    text-align: center;
}
.etm-btn-primary {
    background: #6366f1;
    color: #fff;
}
.etm-btn-primary:hover {
    background: #4f46e5;
    color: #fff;
}
.etm-btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #475569;
}
.etm-btn-outline:hover {
    border-color: #6366f1;
    color: #6366f1;
}
.etm-btn-sm { padding: 6px 14px; font-size: 13px; }
.etm-btn-lg { padding: 14px 28px; font-size: 16px; }
.etm-btn-block { display: block; width: 100%; }

/* ── Forms ── */
.etm-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .15s;
    background: #fff;
}
.etm-input:focus {
    border-color: #6366f1;
    outline: none;
}
.etm-form-group {
    margin-bottom: 16px;
}
.etm-form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

/* ── Alerts ── */
.etm-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.etm-alert-success { background: #dcfce7; color: #166534; }
.etm-alert-danger { background: #fee2e2; color: #991b1b; }
.etm-alert-info { background: #e0e7ff; color: #3730a3; }

/* ── Badges ── */
.etm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.etm-badge-success { background: #dcfce7; color: #166534; }
.etm-badge-warning { background: #fef3c7; color: #92400e; }
.etm-badge-danger { background: #fee2e2; color: #991b1b; }
.etm-badge-info { background: #e0e7ff; color: #3730a3; }
.etm-badge-secondary { background: #f1f5f9; color: #475569; }

/* ── Ribbon Labels ── */
.etm-event-card {
    position: relative;
}
.etm-ribbon {
    position: absolute;
    top: 12px;
    left: 0;
    z-index: 2;
    background: #6366f1;
    color: #fff;
    padding: 4px 14px 4px 10px;
    border-radius: 0 4px 4px 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.etm-ribbon-orange { background: #f59e0b; }
.etm-ribbon-red { background: #ef4444; }
.etm-ribbon-green { background: #22c55e; }
.etm-ribbon-purple { background: #8b5cf6; }
.etm-ribbon-postponed { background: #f59e0b; color: #fff; }
.etm-ribbon-sold-out { background: #ef4444; color: #fff; }
.etm-ribbon-cancelled { background: #6b7280; color: #fff; }
.etm-ribbon-inline {
    position: static;
    display: inline-block;
    margin-bottom: 8px;
    border-radius: 4px;
    padding: 4px 12px;
}

/* Event status card styles */
.etm-event-postponed { opacity: 0.85; }
.etm-event-cancelled { opacity: 0.6; filter: grayscale(50%); }
.etm-event-sold_out { }

/* Status alert boxes in event detail */
.etm-status-alert {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 16px;
}

.etm-status-alert h4 {
    margin: 0 0 8px;
    font-size: 18px;
}

.etm-status-alert p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.etm-status-alert .etm-new-date {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.etm-status-postponed {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    color: #92400e;
}

.etm-status-cancelled {
    background: #f3f4f6;
    border: 2px solid #6b7280;
    color: #374151;
}

.etm-status-refunding {
    background: #dbeafe;
    border: 2px solid #3b82f6;
    color: #1e40af;
}

.etm-status-sold-out {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

/* ══════════════════════════════════════════
   Events Grid — supports 1–4 column layouts
   ══════════════════════════════════════════ */
.etm-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
/* Explicit column overrides from [etm_events columns="X"] */
.etm-grid-cols-1 { grid-template-columns: 1fr; }
.etm-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.etm-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.etm-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Event Card ── */
.etm-event-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.etm-event-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.etm-event-card-img-link {
    display: block;
    text-decoration: none;
}
.etm-event-card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #e2e8f0;
    transition: transform .3s;
}
.etm-event-card:hover .etm-event-card-img {
    transform: scale(1.03);
}
.etm-event-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff, #f1f5f9);
}
.etm-placeholder-icon {
    font-size: 48px;
    opacity: .4;
}

.etm-event-card-body {
    padding: 20px;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.etm-event-card-date {
    position: absolute;
    top: -28px;
    right: 16px;
    background: #6366f1;
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.etm-date-month { display: block; font-size: 11px; text-transform: uppercase; }
.etm-date-day { display: block; font-size: 20px; font-weight: 700; }

.etm-event-card-body h3 {
    margin: 0 0 8px;
    font-size: 17px;
}
.etm-event-card-body h3 a {
    color: #1e293b;
    text-decoration: none;
}
.etm-event-card-body h3 a:hover {
    color: #6366f1;
}

.etm-event-date-text {
    font-size: 13px;
    color: #6366f1;
    font-weight: 500;
    margin: 0 0 6px;
}
.etm-event-location {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 8px;
}
.etm-event-excerpt {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
    flex: 1;
}

.etm-event-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}
.etm-event-price {
    font-size: 15px;
    font-weight: 700;
    color: #6366f1;
}

/* ══════════════════════════════════════
   Event Detail Page
   ══════════════════════════════════════ */
.etm-event-cover img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 24px;
}
.etm-event-header h1 {
    font-size: 28px;
    margin: 0 0 8px;
}
.etm-event-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    font-size: 14px;
    color: #64748b;
}

/* Detail page 2-column layout */
.etm-event-detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}
.etm-event-main-col {
    min-width: 0;
}

/* Description */
.etm-event-description {
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.75;
}
.etm-event-description p { margin: 0 0 12px; }
.etm-event-description img { max-width: 100%; height: auto; border-radius: 8px; }

.etm-event-organizer {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.etm-event-sessions {
    margin-bottom: 24px;
}
.etm-event-sessions h3 {
    font-size: 18px;
    margin-bottom: 8px;
}
.etm-event-sessions ul {
    list-style: none;
    padding: 0;
}
.etm-event-sessions li {
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 14px;
}

/* Gallery */
.etm-event-gallery {
    margin-bottom: 24px;
}
.etm-event-gallery h3 {
    font-size: 18px;
    margin-bottom: 12px;
}
.etm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
    gap: 8px;
}
.etm-gallery-grid a {
    display: block;
    overflow: hidden;
    border-radius: 8px;
}
.etm-gallery-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform .2s;
}
.etm-gallery-grid a:hover img {
    transform: scale(1.05);
}

/* Sidebar ticket panel */
.etm-event-sidebar-col {
    position: sticky;
    top: 32px;
}
.etm-ticket-selection {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}
.etm-ticket-selection h3 {
    font-size: 18px;
    margin: 0 0 16px;
}

.etm-ticket-type-card {
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    margin-bottom: 10px;
    transition: border-color .15s;
}
.etm-ticket-type-card:hover {
    border-color: #c7d2fe;
}
.etm-ticket-type-card.etm-sold-out {
    opacity: .5;
}
.etm-tt-info h4 { margin: 0 0 2px; font-size: 15px; }
.etm-tt-price { font-size: 22px; font-weight: 700; color: #6366f1; margin: 2px 0 4px; }
.etm-tt-stock { font-size: 12px; color: #94a3b8; }

/* Standalone page wrapper — full width inside Elementor etc. */
.etm-events-standalone {
    padding-top: 8px;
    padding-bottom: 32px;
}
.etm-event-page-standalone {
    padding-top: 8px;
    padding-bottom: 48px;
}

/* ── Table ── */
.etm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}
.etm-table th, .etm-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}
.etm-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}
.etm-table tfoot td {
    border-top: 2px solid #e2e8f0;
}

/* ── Orders list ── */
.etm-orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
    gap: 16px;
}
.etm-order-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border-left: 4px solid #f59e0b;
}
.etm-order-confirmed {
    border-left-color: #22c55e;
}
.etm-order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8fafc;
}
.etm-order-card-body {
    padding: 14px 16px;
}
.etm-order-card-body p { margin: 4px 0; font-size: 14px; }
.etm-order-card-footer {
    padding: 10px 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 8px;
}

/* ── Tickets grid ── */
.etm-tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 16px;
    margin-top: 16px;
}
.etm-ticket-card-portal {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.etm-ticket-qr { margin-bottom: 12px; }
.etm-ticket-qr img,
.etm-ticket-qr canvas,
.etm-ticket-qr svg { max-width: 100%; height: auto; border-radius: 8px; }
.etm-ticket-code { font-family: monospace; font-size: 16px; font-weight: 700; color: #6366f1; }

/* ── Auth ── */
.etm-auth-container {
    max-width: 400px;
    margin: 60px auto;
}
.etm-auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.etm-auth-card h2 {
    margin: 0 0 24px;
    font-size: 22px;
    text-align: center;
}
.etm-auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}
.etm-auth-links a {
    color: #6366f1;
    text-decoration: none;
}

/* ── Profile form ── */
.etm-profile-form {
    max-width: 500px;
}

/* ── Payment instructions ── */
.etm-payment-instructions {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}
.etm-payment-instructions pre {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 8px 0 0;
}

/* ── Pagination ── */
.etm-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
}

/* ── Utilities ── */
.etm-empty {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}
.etm-text-muted { color: #94a3b8; }
.etm-text-danger { color: #ef4444; }

.etm-order-summary {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ══════════════════════
   Responsive
   ══════════════════════ */
@media (max-width: 1024px) {
    .etm-event-detail-layout {
        grid-template-columns: 1fr;
    }
    .etm-event-sidebar-col {
        position: static;
    }
    .etm-grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .etm-portal-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .etm-portal-nav ul {
        flex-wrap: wrap;
    }
    .etm-portal-user {
        margin-left: 0;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid #e2e8f0;
    }
    .etm-events-grid,
    .etm-grid-cols-2,
    .etm-grid-cols-3,
    .etm-grid-cols-4 {
        grid-template-columns: 1fr;
    }
    .etm-event-header h1 {
        font-size: 22px;
    }
    .etm-ticket-types-list {
        flex-direction: column;
    }
    .etm-event-card-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* ── Ticket View (in-portal) ── */
.etm-ticket-view { max-width: 700px; }
.etm-ticket-display {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    margin-bottom: 24px;
}
.etm-ticket-display-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 24px;
}
.etm-ticket-display-header h3 { font-size: 20px; margin: 0 0 4px; }
.etm-ticket-display-header p { opacity: .85; font-size: 13px; margin: 0; }
.etm-ticket-display-body {
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.etm-ticket-display-info { flex: 1; }
.etm-ticket-detail-row { margin-bottom: 14px; }
.etm-ticket-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: .5px;
    margin-bottom: 2px;
}
.etm-ticket-value { font-size: 15px; font-weight: 600; color: #1e293b; }
.etm-ticket-code-mono { font-family: monospace; font-size: 16px; color: #6366f1; font-weight: 700; }
.etm-ticket-display-qr { flex-shrink: 0; }
.etm-ticket-display-qr img,
.etm-ticket-display-qr svg,
.etm-ticket-display-qr canvas { border: 4px solid #f0f0f0; border-radius: 8px; }
.etm-ticket-display-footer {
    text-align: center;
    padding: 16px;
    background: #fafafa;
    font-size: 12px;
    color: #94a3b8;
    border-top: 2px dashed #e2e8f0;
}
.etm-ticket-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ── Print: hide nav and portal chrome ── */
@media print {
    .etm-portal-nav,
    .etm-no-print,
    .etm-ticket-actions { display: none !important; }
    .etm-portal { padding: 0; max-width: 100%; }
    .etm-portal-content { padding: 0; }
    .etm-ticket-display { box-shadow: none; }
}

@media (max-width: 600px) {
    .etm-ticket-display-body { flex-direction: column; align-items: center; }
    .etm-ticket-display-qr { margin-top: 16px; }
}
