/* Playscheme 2026 Shared Styles */
html, body { height: 100%; }
body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background-color: #f0ebf8; 
    margin: 0; padding: 20px; color: #202124;
    display: flex; flex-direction: column;
}

.container { flex: 1 0 auto; max-width: 640px; margin: auto; width: 100%; }

@media (min-width: 600px) {
    .container { max-width: 800px; }
}

/* Card Styling */
.form-card {
    background: white; border-radius: 8px; margin-bottom: 12px; 
    padding: 24px; border: 1px solid #dadce0; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.header-card { border-top: 10px solid #673ab7; }
.header-image { max-width: 100%; height: auto; margin-bottom: 20px; display: block; border-radius: 4px; }

h1 { font-size: 32px; margin: 0 0 8px 0; font-weight: 400; }
h2 { font-size: 22px; margin: 0 0 16px 0; font-weight: 400; }
h3 { color: #673ab7; font-size: 20px; margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }

/* Form Fields */
label { display: block; margin-bottom: 12px; font-weight: 500; font-size: 16px; }
.required-star, .required { color: #d93025; margin-left: 3px; }

input[type="text"], input[type="email"], input[type="date"], input[type="number"], input[type="tel"], textarea, select { 
    width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid #dadce0; 
    font-size: 14px; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    outline: none; transition: border-bottom 0.2s; box-sizing: border-box; background: transparent;
}
input:focus, select:focus { border-bottom: 2px solid #673ab7; }

/* Layout Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }

/* Dashboard Record Cards */
.record-card {
    background: #f8f9fa;
    border: 1px solid #dadce5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 600px) {
    .record-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
}

.record-info h3 { margin: 0; color: #2e7d32; font-size: 1.2em; border: none; padding: 0; }
.record-info p { margin: 5px 0 0; font-size: 0.85em; color: #666; font-family: monospace; }

.record-actions { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
    align-items: center; 
    justify-content: flex-start; 
    width: 100%;
}

/* Buttons */
button, .btn { 
    background: #673ab7; color: white; border: none; padding: 10px 24px; 
    border-radius: 4px; cursor: pointer; font-weight: 500; text-decoration: none; 
    display: inline-block; text-align: center; 
}
.btn-secondary { background: #e0e0e0; color: #202124; }

.btn-small {
    padding: 10px 12px; 
    font-size: 0.85em; 
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    flex: 1 1 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap; 
    height: 42px;
}

.btn-staff { background: #2e7d32; color: white; }
.btn-health { background: #1976d2; color: white; }
.btn-health.incomplete { background: #d32f2f !important; }

/* Loading & Overlays */
#overlay, #loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999;
}

.hourglass {
    display: inline-block;
    position: relative;
    width: 80px; height: 80px;
}
.hourglass:after {
    content: " ";
    display: block;
    border-radius: 50%;
    width: 0; height: 0;
    margin: 8px;
    box-sizing: border-box;
    border: 32px solid #2e7d32;
    border-color: #2e7d32 transparent #2e7d32 transparent;
    animation: hourglass-anim 1.2s infinite;
}

@keyframes hourglass-anim {
    0% { transform: rotate(0); animation-timing-function: cubic-bezier(0.55, 0.05, 0.67, 0.19); }
    50% { transform: rotate(900deg); animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
    100% { transform: rotate(1800deg); }
}

/* Tables & Misc */
.meals-table, .consent-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.meals-table th, .consent-table th { color: #70757a; font-weight: 500; padding: 10px; border-bottom: 1px solid #dadce0; }
.meals-table td, .consent-table td { padding: 12px 5px; border-bottom: 1px solid #dadce0; text-align: center; }
.meals-table td:first-child, .consent-table td:first-child { text-align: left; }

.success-card { background: #e8f0fe; padding: 30px; border-radius: 12px; margin-top: 20px; border: 1px solid #dadce0; }
footer { flex-shrink: 0; text-align: center; padding: 20px; font-size: 13px; color: #70757a; }

.option { display: flex; align-items: center; gap: 8px;}
.option label { display: inline; margin: 0; font-weight: normal; }

.gateway-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.option-box {
    padding: 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    transition: border-color 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.option-box:hover { border-color: #2e7d32; }
.email-search {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: left;
}

#searchStatus {
    margin-top: 10px;
    font-weight: bold;
    min-height: 20px;
}

.error-msg {
    display: none;        /* Hidden by default */
    color: #cf1322;      /* Professional "error" red */
    font-size: 0.85rem;   /* Slightly smaller than label text */
    font-weight: 600;     /* Make it stand out */
    margin-top: 4px;      /* Gap between input and error */
    animation: fadeIn 0.3s ease-in; /* Optional: smooth fade-in */
}

/* Optional: smooth animation when error appears */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

/* This pushes the Cancel button to the far right */
#cancelBtn {
    margin-left: auto; 
    background-color: #f8f9fa;
    color: #3c4043;
    border: 1px solid #dadce0;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

#cancelBtn:hover {
    background-color: #f1f3f4;
    border-color: #dcdcdc;
}


/* === Hoodie Step Styles === */
.hoodie-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
@media (min-width: 600px) {
    .hoodie-layout {
        flex-direction: row;
        align-items: flex-start;
    }
}
.hoodie-preview-area {
    position: relative;
    background: #f0ebf8;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 260px;
    flex-shrink: 0;
}
@media (max-width: 599px) {
    .hoodie-preview-area { max-width: 100%; }
}
#hoodieDisplay {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
.hoodie-logo-overlay {
    position: absolute;
    filter: brightness(0) invert(1);
    mix-blend-mode: screen;
    pointer-events: none;
}
.hoodie-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}
.hoodie-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.hoodie-style-btn,
.hoodie-view-btn {
    padding: 8px 14px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: #202124;
    transition: background 0.2s;
}
.hoodie-style-btn.active,
.hoodie-view-btn.active {
    background: #673ab7;
    color: white;
    border-color: #512da8;
}
.hoodie-colour-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    align-items: center;
}
.hoodie-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.hoodie-swatch.active {
    border-color: #333;
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
