/* Shared app theme – dark, consistent with landing page. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background-color: #0a0f1a;
    color: #e5e7eb;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Header – hide when page uses .page-no-header */
header {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.6));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 0;
}

header p {
    color: #9ca3af;
    font-size: 14px;
    margin-top: 8px;
}

header a {
    color: #14b8a6;
    text-decoration: none;
    font-weight: 500;
}

header a:hover {
    color: #2dd4bf;
    text-decoration: underline;
}

.page-no-header header {
    display: none;
}

/* Main content */
main {
    min-height: 40vh;
}

h1, h2, h3, h4 {
    color: #e5e7eb;
}

/* Cards */
.event-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.event-card:hover {
    border-color: rgba(20, 184, 166, 0.4);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.2);
}

.event-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.event-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.event-card p {
    color: #9ca3af;
    margin-bottom: 8px;
}

/* Role items (roster / event views) */
.role-item {
    padding: 12px 16px;
    margin: 8px 0;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border-left: 4px solid rgba(148, 163, 184, 0.3);
}

.role-item.open {
    background: rgba(127, 29, 29, 0.2);
    border-left-color: #f87171;
}

.roles {
    margin-top: 12px;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.status.confirmed {
    background: rgba(20, 184, 166, 0.25);
    color: #5eead4;
}

.status.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fde047;
}

.status.open {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
}

.status.assigned-unregistered {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    font-style: italic;
    font-weight: 500;
}

/* Content sections (landing + policy-style pages) */
.content-section {
    padding: 48px 0;
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #e5e7eb;
}

.section-subtitle {
    font-size: 18px;
    color: #9ca3af;
    margin-bottom: 32px;
    line-height: 1.7;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(20, 184, 166, 0.5);
    box-shadow: 0 12px 32px rgba(15, 118, 110, 0.3);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e5e7eb;
}

.card-body {
    font-size: 16px;
    line-height: 1.7;
    color: #9ca3af;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fffbeb;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(249, 115, 22, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #ecfeff;
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(20, 184, 166, 0.5);
    background: linear-gradient(135deg, #2dd4bf, #14b8a6);
}

/* Forms */
.contact-form,
.app-form {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 20px;
    padding: 40px;
    margin-top: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e5e7eb;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background-color: rgba(15, 23, 42, 0.6);
    color: #e5e7eb;
    font-size: 16px;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Policy / legal content (privacy, terms) */
.policy-content {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 20px;
    padding: 48px;
    line-height: 1.8;
}

.policy-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #e5e7eb;
}

.policy-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    color: #e5e7eb;
}

.policy-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: #e5e7eb;
}

.policy-content p {
    font-size: 17px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.policy-content ul,
.policy-content ol {
    font-size: 17px;
    color: #9ca3af;
    margin-bottom: 16px;
    padding-left: 24px;
}

.policy-content li {
    margin-bottom: 8px;
}

.policy-content strong {
    color: #e5e7eb;
    font-weight: 600;
}

/* Links */
.footer-link,
.back-link {
    color: #14b8a6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover,
.back-link:hover {
    color: #2dd4bf;
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-top: 32px;
    font-size: 16px;
}

main a:not(.btn):not(.footer-link):not(.back-link) {
    color: #14b8a6;
    text-decoration: none;
}

main a:not(.btn):not(.footer-link):not(.back-link):hover {
    color: #2dd4bf;
    text-decoration: underline;
}

/* Nested service blocks (e.g. calendar view) */
.service-event {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.service-event h3,
.service-event h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #e5e7eb;
}

.service-event p {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 10px;
}

/* Tables (admin dashboard) */
.app-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.app-table th,
.app-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-table th {
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font-weight: 600;
}

.app-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.3);
}

.app-table a {
    color: #14b8a6;
    font-weight: 500;
}

.app-table a:hover {
    color: #2dd4bf;
}

/* QR page */
.qr-container {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.6));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto 32px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.qr-container h2 {
    color: #e5e7eb;
    font-size: 24px;
    margin-bottom: 16px;
    white-space: nowrap;
}

.qr-code {
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 16px;
    display: inline-block;
    margin: 24px 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.qr-code img {
    max-width: 300px;
    height: auto;
    display: block;
}

.qr-instructions {
    font-size: 16px;
    color: #9ca3af;
    margin-bottom: 24px;
    line-height: 1.8;
}

.qr-instructions .church-name {
    white-space: nowrap;
}

.direct-link {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: #ecfeff;
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.4);
    transition: all 0.2s ease;
}

.direct-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(20, 184, 166, 0.5);
    color: #ecfeff;
}

.promo-section {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.6));
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    padding: 32px;
    margin-top: 40px;
    text-align: left;
}

.promo-section h2 {
    color: #e5e7eb;
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li::before {
    content: "✓";
    color: #14b8a6;
    font-weight: bold;
    font-size: 18px;
}

.feature-description {
    color: #9ca3af;
    line-height: 1.5;
}

/* Utility */
.roster-legend,
.note-muted {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 12px;
}

main > p {
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 20px 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px 12px;
    }

    header h1 {
        font-size: 20px;
    }

    .event-card {
        padding: 20px 16px;
    }

    .event-card h2 {
        font-size: 18px;
    }

    .policy-content {
        padding: 32px 24px;
    }

    .policy-content h1 {
        font-size: 28px;
    }

    .section-title {
        font-size: 28px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .qr-container {
        padding: 24px 20px;
    }

    .qr-code img {
        max-width: 250px;
    }

    .promo-section {
        padding: 24px 20px;
    }
}

/* ============================================================
   Print-friendly pages (on screen): light theme, ink-efficient
   ============================================================ */
body.print-friendly {
    background-color: #f5f5f5;
    color: #333;
}

body.print-friendly .container {
    background: transparent;
}

body.print-friendly header {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.print-friendly header h1,
body.print-friendly header p {
    color: #333;
}

body.print-friendly header p {
    color: #666;
}

body.print-friendly main,
body.print-friendly .event-card,
body.print-friendly .policy-content,
body.print-friendly .roster-legend,
body.print-friendly .note-muted,
body.print-friendly main > p {
    color: #333;
}

body.print-friendly .roster-legend,
body.print-friendly .note-muted {
    color: #666;
}

body.print-friendly a {
    color: #0066cc;
}

body.print-friendly a:hover {
    color: #004499;
    text-decoration: underline;
}

body.print-friendly .print-header h1,
body.print-friendly .print-header p {
    color: #333;
}

body.print-friendly .print-header p {
    color: #666;
}

/* Headings in print-friendly views must be dark on white background */
body.print-friendly h1,
body.print-friendly h2,
body.print-friendly h3,
body.print-friendly h4 {
    color: #111 !important;
}

/* When actually printing: force light mode to save ink */
@media print {
    body,
    body.app-theme,
    body.print-friendly {
        background: #fff !important;
        color: #333 !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    header {
        background: #fff !important;
        color: #333 !important;
        border: none !important;
        border-bottom: 2px solid #333 !important;
        box-shadow: none !important;
        page-break-after: avoid;
    }

    header h1,
    header p {
        color: #333 !important;
    }

    h1, h2, h3, h4 {
        color: #111 !important;
    }

    main,
    .event-card,
    .policy-content,
    .card,
    .service-event,
    .qr-container,
    .promo-section {
        background: #fff !important;
        color: #333 !important;
        border-color: #ddd !important;
        box-shadow: none !important;
    }

    .event-card h2,
    .event-card h3,
    .policy-content h1,
    .policy-content h2,
    .policy-content h3,
    .card-title,
    .section-title {
        color: #333 !important;
    }

    .event-card p,
    .policy-content p,
    .card-body,
    .section-subtitle,
    .roster-legend,
    .note-muted,
    main > p,
    .qr-instructions,
    .feature-description {
        color: #333 !important;
    }

    a {
        color: #333 !important;
    }

    .role-item {
        background: #f9f9f9 !important;
        border-left-color: #ddd !important;
    }

    .role-item.open {
        background: #fff5f5 !important;
        border-left-color: #c00 !important;
    }

    .status.confirmed {
        background: #e6f4ea !important;
        color: #137333 !important;
    }

    .status.pending {
        background: #fef7e0 !important;
        color: #7d4e00 !important;
    }

    .status.open {
        background: #fce8e6 !important;
        color: #c5221f !important;
    }

    .status.assigned-unregistered {
        background: #f1f3f4 !important;
        color: #333 !important;
    }

    .app-table-wrap {
        border-color: #ddd !important;
    }

    .app-table th {
        background: #f5f5f5 !important;
        color: #333 !important;
        border-color: #333 !important;
    }

    .app-table td {
        border-color: #ddd !important;
        color: #333 !important;
    }

    .app-table a {
        color: #333 !important;
    }

    .no-print {
        display: none !important;
    }
}
