/**
 * Missionary Trips Planner — Frontend Styles
 * Sacred Canvas Design System
 */

/* Material Symbols baseline */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Dashboard wrapper — break out of theme container and take full width */
.mtp-dashboard-wrap {
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    overflow-x: hidden;
}
.mtp-auth-wrap,
.mtp-join-wrap,
.mtp-join-prompt,
.mtp-trips-grid-wrap,
.mtp-trip-detail-wrap {
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
}

.mtp-dashboard-wrap *,
.mtp-auth-wrap *,
.mtp-join-wrap *,
.mtp-join-prompt *,
.mtp-trips-grid-wrap *,
.mtp-trip-detail-wrap * {
    box-sizing: border-box;
}

/* Font overrides */
.font-headline {
    font-family: 'Manrope', system-ui, sans-serif;
}
.font-body,
.font-label {
    font-family: 'Inter', system-ui, sans-serif;
}

/* Message boxes */
.mtp-msg-success {
    background: #dcfce7;
    color: #166534;
}
.mtp-msg-error {
    background: #fef2f2;
    color: #991b1b;
}

/* Loading state for buttons */
.mtp-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}
.mtp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mtp-spin 0.6s linear infinite;
}
@keyframes mtp-spin {
    to { transform: rotate(360deg); }
}

/* Smooth transitions for group option reveal */
#mtp-group-select,
#mtp-group-name {
    transition: all 0.2s ease;
}

/* Ensure mobile nav doesn't overlap content */
@media (max-width: 767px) {
    .mtp-main-content {
        padding-bottom: 100px !important;
        margin-left: 0 !important;
    }
}

/* Tab button transitions */
.mtp-tab-btn {
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.mtp-tab-btn:active {
    transform: scale(0.98);
}

/* Tab content transitions */
.mtp-tab-content {
    animation: mtp-tab-fade 0.2s ease-out;
}
@keyframes mtp-tab-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Leave group/trip button active states */
.mtp-leave-trip-btn,
.mtp-leave-group-btn {
    -webkit-tap-highlight-color: transparent;
}

/* Trip card link styling */
.mtp-dashboard-wrap a:not([class]) {
    text-decoration: none;
}
.mtp-dashboard-wrap .group:hover {
    transform: translateY(-2px);
}

/* Smooth card interactions */
.mtp-dashboard-wrap .shadow-sm {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Table hover actions transition */
.mtp-dashboard-wrap table .group .flex {
    transition: opacity 0.2s ease;
}

/* Notice styling for already-logged-in state */
.mtp-notice {
    background: #f3f4f5;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}
.mtp-notice a {
    color: #001c40;
    font-weight: 700;
    text-decoration: underline;
}

.mtp-error {
    background: #fef2f2;
    color: #991b1b;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal animations */
#mtp-quick-join-modal .bg-surface-container-lowest,
#mtp-leave-modal .bg-surface-container-lowest {
    animation: mtp-modal-in 0.2s ease-out;
}
@keyframes mtp-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal responsive: full-screen on mobile */
@media (max-width: 639px) {
    #mtp-quick-join-modal .bg-surface-container-lowest {
        border-radius: 1rem 1rem 0 0 !important;
        max-height: 90vh;
        overflow-y: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 !important;
        width: 100% !important;
    }
}

/* Role toggle cards */
.mtp-role-option {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Responsive iframe for waiver form */
@media (max-width: 639px) {
    #mtp-waiver-card iframe,
    #mtp-quick-join-modal iframe {
        min-height: 300px !important;
        height: 350px !important;
    }
}

/* Better touch targets on mobile */
@media (max-width: 767px) {
    .mtp-quick-join-btn,
    .mtp-join-trip-btn,
    .mtp-leave-trip-btn,
    .mtp-leave-group-btn {
        min-height: 44px;
    }
    .mtp-dashboard-wrap select,
    .mtp-auth-wrap select,
    .mtp-dashboard-wrap input[type="text"],
    .mtp-dashboard-wrap input[type="email"],
    .mtp-dashboard-wrap input[type="tel"],
    .mtp-auth-wrap input[type="text"],
    .mtp-auth-wrap input[type="email"],
    .mtp-auth-wrap input[type="password"] {
        font-size: 16px !important; /* prevents iOS zoom on focus */
    }
    /* Stack trip meta vertically on very small screens */
    .mtp-dashboard-wrap .flex-wrap.gap-x-4 {
        gap: 4px 12px;
    }
}

/* Small phone adjustments */
@media (max-width: 374px) {
    .mtp-tab-btn span:not(.material-symbols-outlined):not(.rounded-full) {
        font-size: 12px;
    }
    .mtp-tab-btn .material-symbols-outlined {
        font-size: 16px;
    }
}

/* Header button shortcode */
.mtp-header-btn-wrap {
    -webkit-tap-highlight-color: transparent;
}
.mtp-header-profile-toggle:hover {
    background: #f3f4f5 !important;
}
.mtp-header-profile-toggle[aria-expanded="true"] {
    background: #f3f4f5 !important;
    box-shadow: 0 0 0 2px rgba(0,28,64,0.08);
}
@media (max-width: 480px) {
    .mtp-header-name {
        display: none !important;
    }
    .mtp-header-profile-toggle {
        padding: 4px !important;
        border-radius: 50% !important;
    }
    .mtp-header-profile-toggle svg {
        display: none !important;
    }
    .mtp-header-dropdown {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        bottom: 8px !important;
        min-width: auto !important;
        border-radius: 20px !important;
        box-shadow: 0 -10px 60px -10px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.04) !important;
    }
}

/* Sacred Canvas Color Utilities (for when Tailwind config doesn't load) */
.text-primary { color: #001c40 !important; }
.text-secondary { color: #c20726 !important; }
.text-tertiary { color: #FACC15 !important; }
.bg-primary-container { background-color: #001c40 !important; }
.text-on-surface { color: #191c1d !important; }
.text-on-surface-variant { color: #44474e !important; }
.bg-surface { background-color: #f8f9fa !important; }
.bg-surface-container-low { background-color: #f3f4f5 !important; }
.bg-surface-container-lowest { background-color: #ffffff !important; }
.bg-surface-container-high { background-color: #e7e8e9 !important; }
