/*
|--------------------------------------------------------------------------
| NBRetreats — Global Stylesheet
|--------------------------------------------------------------------------
|
| Goals:
| - Consistent layout and typography
| - Simple, reusable components (cards, tables, buttons, forms)
| - Reasonable defaults ("minimums") that reduce per-page styling drift
|
*/

/* ================================================================
   BASE
   ================================================================ */

:root {
    --bg: #fafafa;
    --text: #222;

    --border: #dee2e6;
    --muted: #666;

    --primary: #2d6cdf;
    --primary-hover: #1f4fbf;
    --primary-active: #163a8c;

    --secondary: #6c757d;
    --secondary-hover: #565e64;

    --danger: #dc3545;
    --danger-hover: #bb2d3b;

    --flash-success-bg: #d4edda;
    --flash-success-border: #c3e6cb;

    --flash-error-bg: #f8d7da;
    --flash-error-border: #f5c6cb;

    --flash-info-bg: #e7f1ff;
    --flash-info-border: #b3ccff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    margin: 2rem;
    background: var(--bg);
    color: var(--text);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

/* ================================================================
   CONTAINER / PAGE WIDTH
   ================================================================ */

.container {
    max-width: 1200px; /* was 1000px */
    width: 100%;
}

/* ================================================================
   NAVIGATION
   ================================================================ */

.nav {
    margin-bottom: 1rem;
}

.nav a {
    margin-right: 1rem;
    text-decoration: none;
    color: #0645ad;
}

.nav a:hover {
    text-decoration: underline;
}

.nav-user {
    margin-right: 1.5rem;
    color: #333;
}

/* ================================================================
   FLASH MESSAGES
   ================================================================ */

.flash-success,
.flash-error,
.flash-info {
    padding: 10px;
    border: 1px solid transparent;
    margin-bottom: 15px;
    border-radius: 6px;
}

.flash-success {
    background: var(--flash-success-bg);
    border-color: var(--flash-success-border);
}

.flash-error {
    background: var(--flash-error-bg);
    border-color: var(--flash-error-border);
}

.flash-info {
    background: var(--flash-info-bg);
    border-color: var(--flash-info-border);
}

/* ================================================================
   CARD SYSTEM
   ================================================================ */

.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
}

.card-subtitle {
    margin-top: -6px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--muted);
}

.card-section {
    margin-top: 12px;
}

/* Simple header/body helpers (you already use these in many views) */
.card-header {
    font-weight: 700;
    margin-bottom: 10px;
}

.card-body {
    /* intentionally minimal */
}

/* ================================================================
   GRID LAYOUTS
   ================================================================ */

/* Used all over the app */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}

/* Responsive stacking */
@media (max-width: 800px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   ADMIN — ACTION GRID
   ================================================================ */

.admin-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.admin-action-btn {
    width: 100%;
    text-align: center;
}

/* ================================================================
   RETREAT WORKSPACE LAYOUT
   ================================================================ */

.workspace-header-grid {
    display: grid;
    grid-template-columns: 1fr 210px; /* wider metadata column */
    gap: 20px;
    align-items: start;
}

.workspace-title {
    margin-top: 0;
}

.workspace-meta-row {
    margin-top: 10px;
}

/* Main workspace: consistent sidebar width, main can overflow horizontally for wide tables */
.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px; /* prevent sidebar squish */
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

/* Allow wide content (lodging tables) without crushing the sidebar */
.workspace-main {
    min-width: 0;
}

/* If a section contains a wide table, it can scroll within the main area */
.workspace-main .card-body {
    overflow-x: auto;
}

/* Sidebar menu buttons */
.workspace-menu-btn {
    width: 100%;
    text-align: left;
}

.workspace-menu-btn.is-active {
    font-weight: bold;
}

/* Responsive stacking for workspace (keep your current behavior) */
@media (max-width: 800px) {
    .workspace-header-grid {
        grid-template-columns: 1fr;
    }

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

/* ================================================================
   FORMS — DEFAULTS (Minimums)
   ================================================================ */

.form-label {
    display: block;
    margin: 10px 0 6px 0;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
}

textarea {
    min-height: 120px; /* baseline multiline minimum */
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 3px rgba(45,108,223,0.5);
}

/* Horizontal form rows */
.form-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Useful for action rows */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Login form: keep inputs from stretching across the full page width */
.login-form {
    max-width: 520px;
}

/* ================================================================
   BUTTON SYSTEM
   ================================================================ */

button,
input[type="submit"],
.btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #fff;
    background-color: var(--primary);
    border: 1px solid var(--primary-hover);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background-color: var(--primary-hover);
}

button:active,
input[type="submit"]:active,
.btn:active {
    background-color: var(--primary-active);
}

button:disabled,
input[type="submit"]:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary-hover);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger-hover);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

/* ================================================================
   TABLE SYSTEM
   ================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
}

/* Header */
th {
    text-align: left;
    background-color: #f1f3f5;
    color: #333;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
}

/* Cells */
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

/* Hover and zebra */
tr:hover td {
    background-color: #f8f9fa;
}

tr:nth-child(even) td {
    background-color: #fcfcfc;
}

/* Table links */
table a {
    font-weight: 500;
    color: var(--primary);
}

table a:hover {
    text-decoration: underline;
}

/* Inline action forms in table cells */
td .form-inline {
    margin-right: 6px;
}

/* Optional helper: wrap wide tables to allow horizontal scrolling */
.table-scroll {
    width: 100%;
    overflow-x: auto;
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */

.progress {
    width: 300px;
    border: 1px solid #999;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    background: #4caf50;
    color: white;
    padding: 4px 0;
    text-align: center;
}

/* ================================================================
   STATUS BADGES
   ================================================================ */

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Legacy semantic aliases */
.status-active   { background-color: #e6f4ea; color: #1e7e34; }
.status-canceled { background-color: #f8d7da; color: #842029; }

/* Generic variants */
.badge-success   { background-color: #e6f4ea; color: #1e7e34; }
.badge-danger    { background-color: #f8d7da; color: #842029; }
.badge-warning   { background-color: #fff3cd; color: #856404; }
.badge-info      { background-color: #e7f1ff; color: #1f4fbf; }
.badge-secondary { background-color: #e9ecef; color: #495057; }

/* ================================================================
   ATTENDEE VISUALS
   ================================================================ */

.attendee-canceled-row {
    background-color: #f5f5f5;
    color: #666666;
}

.attendee-canceled-row td {
    text-decoration: line-through;
}

/* canceled attendee cards appear visually subdued */
.card.attendee-canceled {
    opacity: 0.6;
}

/* ================================================================
   DASHBOARD — TASK MINI CARDS
   ================================================================ */

.dashboard-task-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
    align-items: start;
}

/* Fall back to 2 columns on medium, 1 on small */
@media (max-width: 1000px) {
    .dashboard-task-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .dashboard-task-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-task-card {
    border-radius: 12px;   /* more rounded */
    padding: 12px 14px;    /* slightly tighter than full cards */
    margin-bottom: 0;      /* grid handles spacing */
}

.dashboard-task-card .card-body {
    padding: 0;            /* prevent nested padding bloat */
}

/* ================================================================
   DASHBOARD HELPERS
   ================================================================ */

.dashboard-task-completed {
    text-decoration: line-through;
    opacity: 0.75;
}