/* Widows Sons Rides - Main Stylesheet */

/* ============================================================================
   CSS VARIABLES - Black and Gold Theme
   ============================================================================ */
:root {
    --primary: #d4a017;
    --primary-dark: #b8860b;
    --secondary: #4a4a4a;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;

    --bg: #f5f5f5;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #5a5a5a;
    --border: #d4d4d4;

    --gold: #d4a017;
    --gold-light: #f0d77a;
    --black: #1a1a1a;

    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ============================================================================
   HEADER - Black and Gold
   ============================================================================ */
.site-header {
    background: var(--black);
    color: var(--gold);
    padding: 1rem 0;
    border-bottom: 3px solid var(--gold);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.logo:hover {
    text-decoration: none;
    color: var(--gold-light);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--gold);
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--gold-light);
    text-decoration: none;
}

/* ============================================================================
   FOOTER - Black and Gold
   ============================================================================ */
.site-footer {
    background: var(--black);
    color: var(--gold);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
    border-top: 3px solid var(--gold);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--gold);
    color: var(--black);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1.0625rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================================================
   FLASH MESSAGES
   ============================================================================ */
.flash {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* ============================================================================
   CHAPTER SELECTION
   ============================================================================ */
.chapter-select {
    text-align: center;
    padding: 2rem 0;
}

.chapter-select h2 {
    margin-bottom: 0.5rem;
}

.chapter-select > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.chapter-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chapter-card:hover {
    text-decoration: none;
    border-color: var(--gold);
    box-shadow: var(--shadow-lg);
}

.chapter-card h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.chapter-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.chapter-card .ride-count {
    font-size: 0.875rem;
    color: var(--gold);
    font-weight: 600;
}

/* ============================================================================
   BREADCRUMB
   ============================================================================ */
.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

/* ============================================================================
   PAGE HEADER
   ============================================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
}

.chapter-description {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ============================================================================
   RIDES LIST
   ============================================================================ */
.rides-list h2 {
    margin-bottom: 1.5rem;
}

.ride-card {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    align-items: flex-start;
}

.ride-date {
    text-align: center;
    min-width: 70px;
    padding: 0.75rem;
    background: var(--gold);
    color: var(--black);
    border-radius: var(--radius);
}

.ride-date .day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.ride-date .month {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.ride-date .year {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}

.ride-date .tbc {
    font-size: 0.875rem;
    font-weight: 600;
}

.ride-info {
    flex: 1;
}

.ride-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.ride-info h3 a {
    color: var(--text);
}

.ride-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.ride-type {
    background: #e2e8f0;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.start-points {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.start-point {
    margin-bottom: 0.25rem;
}

.signup-count {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 500;
}

.ride-actions {
    display: flex;
    align-items: center;
}

/* ============================================================================
   BADGE
   ============================================================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.badge-featured {
    background: var(--gold);
    color: var(--black);
}

.badge-cancelled {
    background: var(--danger);
    color: white;
}

.badge-completed {
    background: var(--success);
    color: white;
}

.badge-scheduled {
    background: var(--secondary);
    color: white;
}

.badge-external {
    background: #6366f1;
    color: white;
}

/* ============================================================================
   STATUS BANNERS
   ============================================================================ */
.ride-cancelled-banner,
.ride-completed-banner,
.ride-unavailable {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    text-align: center;
}

.ride-cancelled-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

.ride-completed-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
}

.ride-unavailable {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* ============================================================================
   CONTACT DETAILS
   ============================================================================ */
.contact-details,
.chapter-contacts {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
}

.contact-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.contact-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.contact-bike {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.contact-phone,
.contact-email {
    font-size: 0.9rem;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-social {
    font-size: 0.85rem;
}

.btn-facebook {
    background: #1877f2;
    color: white;
}

.btn-facebook:hover {
    background: #166fe5;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-whatsapp:hover {
    background: #22c55e;
}

/* ============================================================================
   RIDE LEADER
   ============================================================================ */
.ride-leader {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* ============================================================================
   CHAPTER HEADER
   ============================================================================ */
.chapter-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.chapter-header-badge {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius);
}

/* ============================================================================
   PAST RIDE STYLING
   ============================================================================ */
.past-ride {
    opacity: 0.8;
}

.past-ride .ride-date {
    background: var(--secondary);
}

/* ============================================================================
   RIDE DETAIL
   ============================================================================ */
.ride-detail {
    margin-bottom: 2rem;
}

.ride-header {
    margin-bottom: 2rem;
}

.ride-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.ride-meta-large {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-muted);
}

.ride-meta-large .date {
    font-weight: 600;
    color: var(--gold);
}

.start-points-detail h2,
.route-section h2,
.stops-section h2,
.notes-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.start-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.start-point-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--gold);
}

.start-point-card.secondary {
    border-left-color: var(--secondary);
}

.start-point-card h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.start-point-card .location {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.start-point-card .time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.linked-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.linked-info a {
    font-weight: 600;
}

/* ============================================================================
   DATE CLASH WARNING
   ============================================================================ */
.date-clash-box {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.date-clash-box strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.date-clash-box ul {
    margin: 0;
    padding-left: 1.25rem;
}

.date-clash-box li {
    margin-bottom: 0.25rem;
}

.date-clash-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.date-clash-error {
    background: #fef2f2;
    border-color: #dc2626;
    color: #991b1b;
}

.clash-error {
    font-weight: 600;
}

.clash-note {
    margin-top: 0.75rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    font-style: italic;
}

.route-section,
.stops-section,
.notes-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.route-description,
.stops-description {
    line-height: 1.8;
    color: var(--text-muted);
}

/* ============================================================================
   SIGNUP FORM
   ============================================================================ */
.signup-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.signup-section h2 {
    margin-bottom: 1.5rem;
}

.signup-form {
    max-width: 700px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.form-group small {
    color: var(--text-muted);
    font-weight: normal;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.2);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group.horizontal {
    flex-direction: row;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input {
    width: auto;
}

.capacity-full {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--radius);
}

.capacity-info {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ============================================================================
   SIGNUPS LIST (PUBLIC)
   ============================================================================ */
.signups-list {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.signups-list h2 {
    margin-bottom: 1rem;
}

.signups-table {
    width: 100%;
    border-collapse: collapse;
}

.signups-table th,
.signups-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.signups-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.signup-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 2rem;
}

/* ============================================================================
   ADMIN: LOGIN
   ============================================================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    margin-bottom: 0.5rem;
}

.login-box > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.back-link {
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

/* ============================================================================
   ADMIN: DASHBOARD
   ============================================================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dashboard-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dashboard-section.full-width {
    grid-column: 1 / -1;
}

.dashboard-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chapter-list {
    list-style: none;
}

.chapter-list li {
    border-bottom: 1px solid var(--border);
}

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

.chapter-list a {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text);
}

.chapter-list a:hover {
    text-decoration: none;
    color: var(--gold);
}

.chapter-list span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================================================
   ADMIN: DATA TABLES
   ============================================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .row-cancelled {
    background: #fef2f2;
    opacity: 0.8;
}

.data-table .row-completed {
    background: #f0fdf4;
    opacity: 0.8;
}

.data-table code {
    background: #e2e8f0;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn {
    margin-right: 0.25rem;
}

.inline-form {
    display: inline;
}

.tbc {
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================================================
   ADMIN: FORMS
   ============================================================================ */
.admin-form {
    max-width: 800px;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-fieldset legend {
    font-weight: 600;
    padding: 0 0.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    padding-top: 1.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input {
    width: auto;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
}

.filter-bar {
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-form label {
    font-weight: 500;
}

.filter-form select {
    width: auto;
    min-width: 200px;
}

/* ============================================================================
   ADMIN: RIDE VIEW
   ============================================================================ */
.header-actions {
    display: flex;
    gap: 0.5rem;
}

.ride-info-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.5rem 1rem;
}

.info-grid dt {
    font-weight: 600;
    color: var(--text-muted);
}

.signup-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.summary-card .count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

.summary-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.signups-section h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

/* ============================================================================
   ACTIONS BAR
   ============================================================================ */
.actions-bar {
    margin: 1.5rem 0;
    display: flex;
    gap: 0.5rem;
}

/* ============================================================================
   NO DATA
   ============================================================================ */
.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .ride-card {
        flex-direction: column;
    }

    .ride-date {
        align-self: flex-start;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

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

    .info-grid dt {
        margin-top: 0.5rem;
    }
}
