/*******************************************************
 *
 * Package:         Conference registration software
 * Filename:        main.css
 * Date Written:    January 11, 2009
 * Last Updated:    May 4, 2026
 * Author:          John George
 * Abstract:        Main stylesheet for the registration application
 *
 * @author John George <johnkg77@usa.net>
 * @copyright Copyright (c) 2008-2026 John George
 * @version 1.0
 * @abstract Common CSS styles for registration pages including layout, forms, buttons, breadcrumbs, Tabulator tables, and Fomantic-UI customizations
 *
 * $Id: main.css 168 2026-04-11 15:10:00 -0400 john $
 * $LastChangedDate: 2026-04-11 15:10:00 -0400 (Sat, 11 Apr 2026) $
 *
 * Key Styles:
 *      - Page layout and centering
 *      - Registration steps breadcrumb centering
 *      - Form elements and validation
 *      - Button styles and hover effects
 *      - Tabulator table customizations
 *      - Admin registration lookup/edit styles
 *      - Fomantic-UI component overrides
 *
 *******************************************************/

:root {
    --app-font-family: 'Inter', 'Roboto', 'Open Sans', sans-serif;
    --app-font-size-base: 16px;
    --app-line-height-base: 1.5;
    --app-h1-size: 2rem;
    --app-h2-size: 1.75rem;
    --app-h3-size: 1.5rem;
    --app-h4-size: 1.25rem;
    --app-h5-size: 1.125rem;
    --app-h6-size: 1rem;
}

/*
 * Keep vertical scrollbar space reserved so Tabulator focus/edit transitions
 * do not cause horizontal page shift while tabbing through cells.
 */
html {
    overflow-y: scroll;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1e3a8a, #6b7280);
    width: 100vw;
    font-family: var(--app-font-family);
    font-size: var(--app-font-size-base);
    line-height: var(--app-line-height-base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--app-font-family);
    font-weight: 700;
    line-height: 1.25;
    margin-top: 0;
}

h1 {
    font-size: var(--app-h1-size);
}

h2 {
    font-size: var(--app-h2-size);
}

h3 {
    font-size: var(--app-h3-size);
}

h4 {
    font-size: var(--app-h4-size);
}

h5 {
    font-size: var(--app-h5-size);
}

h6 {
    font-size: var(--app-h6-size);
}

input,
textarea,
select,
button,
.ui.button,
.ui.input input,
.ui.dropdown,
.ui.menu,
.ui.message,
.ui.form .field > label {
    font-family: var(--app-font-family);
}

/* Global App Header (Post-Login) */
.app-global-header {
    background-color: #ffffff;
    height: 60px; /* Thin header */
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.app-global-header .header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-global-header .header-logo {
    height: 40px;
    width: auto;
}

.app-global-header .header-title {
    font-family: var(--app-font-family);
    font-size: 1.25rem; /* ~20px */
    font-weight: 600;
    color: #1e3a8a; /* Brand Blue */
    white-space: nowrap;
}

@media (max-width: 900px) {
    .app-global-header .header-title {
        display: none !important;
    }

    .app-global-header .header-content {
        gap: 0;
    }
}

.page-center-container {
    min-height: calc(100vh - 60px); /* Adjust for header height */
    position: relative;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.message-container {
    text-align: center;
    padding-top: 1rem;
}

.content-wrapper {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

.ui.container.segment {
    background: rgba(245, 245, 245, 0.95);
    padding: 2rem 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 960px;
    width: 100%;
    animation: fadeIn 0.4s ease-in-out;
    z-index: 1;
}

.ui.container.segment.new-address {
    max-width: 960px;
    width: 100%;
    padding: 1.5rem;
}

.ui.grid {
    margin: 0;
}

.ui.tabular.menu {
    margin-bottom: 1rem;
}

.ui.tab {
    padding: 1rem;
}

.ui.button {
    margin: 0.5rem 0;
}

.ui.dropdown {
    margin-bottom: 0.5rem;
}

.ui.form .field {
    margin-bottom: 1rem;
}

.ui.list .item {
    margin: 0.5rem 0;
}

.ui.celled.table {
    margin-top: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Center the registration steps breadcrumbs horizontally */
.steps-center {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.steps-center .ui.steps {
    display: inline-flex;
}

.ui.header {
    color: #000000;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: var(--app-h2-size);
    font-weight: 600;
    font-family: var(--app-font-family);
    line-height: 1.25;
}

.ui.header.large {
    font-size: var(--app-h3-size);
}

.ui.header.medium {
    font-size: var(--app-h4-size);
}

.ui.header.small {
    font-size: var(--app-h5-size);
}

.ui.header.tiny {
    font-size: var(--app-h6-size);
}

.ui.form .field input[type='email'],
.ui.form .field input[type='text'],
.ui.form .field input[type='password'] {
    border: 1px solid #6b7280;
    border-radius: 4px;
    padding: 0.8rem;
    transition: all 0.3s ease;
}

.ui.form .field input[type='email']:hover,
.ui.form .field input[type='text']:hover,
.ui.form .field input[type='password']:hover {
    border-color: #1e3a8a;
    box-shadow: 0 0 10px rgba(30, 58, 138, 0.2);
    transform: scale(1.02);
}

/* Keep icons visible when inputs scale on hover */
.ui.input.left.icon,
.ui.input.icon {
    overflow: visible;
}

.ui.input.left.icon i.icon,
.ui.input.icon i.icon {
    z-index: 2;
    pointer-events: none;
}

.ui.form .field input[type='email']:focus,
.ui.form .field input[type='text']:focus,
.ui.form .field input[type='password']:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 8px rgba(30, 58, 138, 0.5);
    outline: none;
}

.ui.form .field.error input.error-field {
    border-color: #b22222;
    background-color: rgba(178, 34, 34, 0.05);
}

.ui.primary.button {
    background-color: #b22222;
    color: #ffffff;
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}

.ui.primary.button:hover {
    background-color: #8b0000;
    transform: translateY(-2px);
}

.ui.secondary.button {
    background-color: #f5f5f5;
    color: #000000;
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    transition:
        background-color 0.3s ease,
        transform 0.2s ease;
}

.ui.secondary.button:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.ui.centered.grid.links {
    text-align: center;
    margin-top: 1rem;
}

.ui.centered.grid.links a {
    color: #1e3a8a;
    text-decoration: none;
    font-size: 0.9rem;
}

.ui.centered.grid.links a:hover {
    text-decoration: underline;
}

.ui.negative.message.server-error,
.ui.positive.message.server-success {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.ui.negative.message.server-error {
    background-color: rgba(178, 34, 34, 0.1);
    color: #b22222;
}

.ui.positive.message.server-success {
    background-color: rgba(0, 128, 0, 0.1);
    color: #008000;
}

.error-msg,
.notice-msg,
.debug-msg {
    margin: 0 auto;
    text-align: left;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.error-msg {
    background-color: rgba(178, 34, 34, 0.1);
    color: #b22222;
    border: 1px solid #b22222;
    max-width: 960px;
}

.notice-msg {
    background-color: rgba(30, 58, 138, 0.1);
    color: #e1e432;
    border: 1px solid #1e3a8a;
    max-width: 960px;
}

.debug-msg {
    background-color: rgba(107, 114, 128, 0.1);
    color: #cac848;
    border: 1px solid #6b7280;
    margin-top: 0;
    margin-bottom: 0;
    width: 100vw;
    max-width: none;
    left: 0;
    transform: none;
    position: relative;
    padding: 1rem 2vw;
    box-sizing: border-box;
    border-radius: 8px;
    z-index: 2;
}

.ui.message {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    background-color: rgba(30, 58, 138, 0.1);
    color: #1e3a8a;
    border: 1px solid #1e3a8a;
    border-radius: 8px;
    padding: 1rem;
}

@media (max-width: 480px) {
    .ui.container.segment {
        padding: 1.5rem;
        margin: 1rem;
    }
    .error-msg,
    .notice-msg,
    .debug-msg {
        margin: 0.5rem auto;
        padding: 0.5rem;
        font-size: 0.95rem;
        width: 100vw;
        max-width: none;
        left: 0;
        transform: none;
    }
}

/* Modify Fomantic-UI Tabular Menu for multi-row support */
/* Enable multi-row tabs */
.ui.tabular.menu {
    display: flex;
    flex-wrap: wrap; /* Allows tabs to wrap into multiple rows */
    gap: 0; /* No gap between items, matching Fomantic-UI's default */
}
.ui.tabular.menu .item {
    flex: 0 0 auto; /* Prevent items from stretching */
    min-width: 100px; /* Minimum width to ensure readability */
    text-align: center; /* Center text for better appearance */
}
/* Optional: Adjust for smaller screens */
@media (max-width: 768px) {
    .ui.tabular.menu .item {
        min-width: 80px; /* Smaller tabs on mobile */
    }
}

/* Main Menu Full Width Styles - Only affects main menu page */
.ui.container.segment.main-menu {
    max-width: 1640px;
    width: 100%;
    padding: 1.5rem;
}

/* Event Edit Full Width Styles - Only affects event edit page */
.ui.container.segment.full-width {
    max-width: none !important;
    width: 100% !important;
    padding: 1.5rem;
}

/* Step-specific tweaks */
#family-table {
    margin-top: 1rem;
}

/* Admin Registration Lookup/Edit Styles */
/* Tabulator table overflow fixes for dropdown and calendar popups */
.tabulator-cell {
    overflow: visible;
}
.tabulator-edit-list {
    z-index: 3000;
    max-height: 260px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 12px 28px rgba(30, 58, 138, 0.16);
}
.tabulator-edit-list .tabulator-edit-list-item {
    padding: 0.45rem 0.65rem;
    transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.tabulator-edit-list .tabulator-edit-list-item.focused {
    background-color: #dbeafe;
    color: #0f172a;
    outline: 2px solid #1e3a8a;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 1px rgba(30, 58, 138, 0.12);
}
.tabulator-edit-list .tabulator-edit-list-item.active,
.tabulator-edit-list .tabulator-edit-list-item:hover {
    background-color: #1e3a8a;
    color: #ffffff;
}
.tabulator-edit-list .tabulator-edit-list-item.active.focused {
    background-color: #1d4ed8;
    color: #ffffff;
    outline: 2px solid #bfdbfe;
}

/* Global Tabulator tooltip appearance (positioning left to Tabulator JS) */
.tabulator-tooltip,
.tabulator-tooltip.tabulator-popup-container {
    background-color: #54c8ff !important;
    color: rgba(0, 0, 0, 0.87) !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    max-width: 300px !important;
    z-index: 10001 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    border: none !important;
}

/* Allow calendar popup to escape Tabulator clipping */
.tabulator-row,
.tabulator-row .tabulator-cell {
    overflow: visible !important;
}
#housing-table .tabulator,
#housing-table .tabulator-tableholder,
#housing-table .tabulator-row {
    overflow: visible !important;
}
/* Calendar popup must be on top of everything */
.ui.calendar .ui.popup {
    z-index: 2147483647 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37) !important;
}
/* Ensure Tabulator table has proper overflow to allow popups */
.tabulator {
    overflow: visible !important;
}
.tabulator-tableholder {
    overflow: visible !important;
}
/* Maintain horizontal scrolling for wide tables */
#housing-table .tabulator-tableholder,
#family-table .tabulator-tableholder,
#workshop-table .tabulator-tableholder {
    overflow-x: auto;
    overflow-y: visible;
}
/* Make readonly cells visually distinct */
.tabulator-cell.readonly-cell {
    background-color: #f0f0f0;
    color: #888;
}

/* Button container styles (replacing inline styles) */
.button-container {
    padding: 1em;
    margin-top: 1em;
    clear: both;
}

/* Search form button layout */
.search-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.search-buttons-right {
    display: flex;
    gap: 0.5em;
}
.search-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.search-options .ui.checkbox {
    margin: 0;
}

/* Subtly highlight populated lookup search criteria so active filters stand out */
#reg-search-form input[type="text"],
#reg-search-form .ui.selection.dropdown {
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#reg-search-form .field.search-field-active > label,
#reg-search-form .field.search-field-active label {
    color: #1e3a8a !important;
    font-weight: 600;
}

#reg-search-form .field.search-field-active input[type="text"],
#reg-search-form .field.search-field-active .ui.selection.dropdown {
    background-color: #eff6ff !important;
    border-color: #93c5fd !important;
    box-shadow: inset 0 0 0 1px rgba(30, 58, 138, 0.08);
}

/* Emergency contact relationship dropdown */
#emer-contact-rel {
    max-height: 200px;
    overflow-y: auto;
}

/* Email permission checkbox alignment */
.email-permission-checkbox {
    margin-top: 2em;
}
