/* =========================================================
   Simple Event Manager – Frontend (Mobile-first & Responsive)
   ========================================================= */

/* ---------- Base ---------- */
.sem-event-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.sem-no-events {
    color: #6b7280;
    font-size: 0.95em;
    margin: 8px 0;
    text-align: center;
}

/* ---------- Event Card ---------- */
.sem-event-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sem-event-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---------- Summary view ---------- */
.sem-event-summary {
    padding: 14px;
}

.sem-event-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

/* Date badge */
.sem-date-badge {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    text-align: center;
}

.sem-date-badge .sem-day {
    font-size: 1.15em;
    font-weight: 700;
}

.sem-date-badge .sem-month {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.9;
}

.sem-event-info {
    flex: 1;
    min-width: 0; /* allow text truncation */
}

.sem-event-title {
    margin: 0 0 6px;
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.3;
    color: #111827;
    word-break: break-word;
}

.sem-event-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sem-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82em;
    color: #6b7280;
    line-height: 1.35;
}

.sem-icon {
    font-size: 0.9em;
    flex-shrink: 0;
}

/* Footer: cost + button */
.sem-event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 4px;
}

.sem-cost {
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 20px;
}

.sem-cost.sem-free {
    background: #dcfce7;
    color: #166534;
}

.sem-attend-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-size: 0.875em;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.sem-attend-btn:hover {
    background: #1d4ed8;
}

.sem-attend-btn:active {
    transform: scale(0.97);
}

/* ---------- Attendance Form ---------- */
.sem-attend-form {
    padding: 16px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.sem-form-header {
    margin-bottom: 12px;
}

.sem-form-header strong {
    display: block;
    font-size: 1em;
    color: #111827;
    margin-bottom: 2px;
}

.sem-form-date {
    font-size: 0.82em;
    color: #6b7280;
}

.sem-desc {
    font-size: 0.9em;
    color: #4b5563;
    line-height: 1.45;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.sem-field {
    margin-bottom: 12px;
}

.sem-field label {
    display: block;
    font-size: 0.82em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.sem-field input[type="text"],
.sem-field input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px; /* prevents iOS zoom */
    color: #111827;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
}

.sem-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sem-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.sem-submit-btn {
    flex: 1;
    min-width: 140px;
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 11px 16px;
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.sem-submit-btn:hover {
    background: #15803d;
}

.sem-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.sem-cancel-btn {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 11px 16px;
    font-size: 0.9em;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.sem-cancel-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Messages */
.sem-form-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.4;
}

.sem-form-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.sem-form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ---------- Larger screens (tablets & up) ---------- */
@media (min-width: 480px) {
    .sem-event-summary {
        padding: 16px;
    }

    .sem-date-badge {
        width: 54px;
        height: 54px;
    }

    .sem-date-badge .sem-day {
        font-size: 1.25em;
    }

    .sem-event-title {
        font-size: 1.1em;
    }

    .sem-event-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .sem-attend-form {
        padding: 18px;
    }
}

/* ---------- Very narrow sidebars / small phones ---------- */
@media (max-width: 360px) {
    .sem-event-header {
        gap: 10px;
    }

    .sem-date-badge {
        width: 44px;
        height: 44px;
    }

    .sem-event-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .sem-attend-btn {
        width: 100%;
        text-align: center;
    }

    .sem-form-actions {
        flex-direction: column;
    }

    .sem-submit-btn,
    .sem-cancel-btn {
        width: 100%;
        text-align: center;
    }
}
