/* ============================================================
   CALTECH CLUB OF SAN DIEGO — Stylesheet (v2)
   Colors: Orange #FF6C0C, White #FFFFFF
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --orange: #FF6C0C;
    --orange-light: #FF8C3C;
    --orange-dark: #E05A00;
    --orange-glow: rgba(255,108,12,0.15);
    --white: #FFFFFF;
    --off-white: #FFF8F3;
    --cream: #FFF1E6;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E5E5E5;
    --gray-300: #D4D4D4;
    --gray-500: #737373;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --success: #059669;
    --warning: #D97706;
    --danger: #EF4444;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-900); background: var(--off-white);
    line-height: 1.6; -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-light); }
img { max-width: 100%; height: auto; }

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: clamp(28px, 4vw, 36px); }
h3 { font-size: 20px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 24px; }

/* --- Navbar --- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gray-200); padding: 0 24px;
}
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--gray-900); }
.logo-icon { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--orange), var(--orange-light)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 18px; font-family: 'Playfair Display', serif; }
.logo-icon-sm { width: 36px; height: 36px; font-size: 16px; border-radius: 8px; }
.logo-img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.logo-img-sm { width: 46px; height: 46px; border-radius: 10px; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.logo-sub { font-size: 11px; color: var(--gray-500); letter-spacing: 0.05em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { background: transparent; color: var(--gray-700); padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.nav-link:hover { background: var(--orange-glow); color: var(--orange); }
.nav-link.active { background: var(--orange-glow); color: var(--orange); font-weight: 600; }
.mobile-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; font-weight: 600; border-radius: 10px; transition: all 0.25s cubic-bezier(0.4,0,0.2,1); padding: 12px 28px; font-size: 15px; text-decoration: none; }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--orange); color: white; box-shadow: 0 4px 12px rgba(255,108,12,0.25); }
.btn-primary:hover { background: var(--orange-light); color: white; box-shadow: 0 8px 24px rgba(255,108,12,0.35); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--orange); border: 2px solid var(--orange); }
.btn-secondary:hover { background: var(--cream); color: var(--orange); transform: translateY(-1px); }
.btn-white { background: white; color: var(--gray-900); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.btn-white:hover { background: var(--off-white); box-shadow: 0 8px 24px rgba(0,0,0,0.12); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--orange); }
.btn-ghost:hover { background: var(--orange-glow); color: var(--orange); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 2px solid var(--danger); }
.btn-danger-outline:hover { background: var(--danger); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Cards --- */
.card { background: white; border-radius: 16px; border: 1px solid var(--gray-200); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: all 0.3s cubic-bezier(0.4,0,0.2,1); }
.card-hover:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.1); transform: translateY(-4px); }
.card-body { padding: 24px; }
.card-body-lg { padding: 40px; }

/* --- Badges --- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.badge-default { background: var(--cream); color: var(--orange); }
.badge-success { background: #ECFDF5; color: var(--success); }
.badge-warning { background: #FFFBEB; color: var(--warning); }
.badge-danger { background: #FEF2F2; color: var(--danger); }
.badge-muted { background: var(--gray-100); color: var(--gray-500); }

/* --- Forms --- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--gray-700); letter-spacing: 0.02em; }
.form-label .required { color: var(--orange); }
.form-input, .form-select, .form-textarea { padding: 12px 16px; border-radius: 10px; border: 2px solid var(--gray-200); font-size: 15px; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.2s; background: white; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--orange); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* --- Hero --- */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--gray-900) 0%, #2D1B0E 50%, var(--gray-900) 100%); padding: 120px 24px 100px; }
.hero-glow-1 { position: absolute; top: -200px; right: -200px; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(255,108,12,0.13), transparent 70%); }
.hero-glow-2 { position: absolute; bottom: -150px; left: -100px; width: 400px; height: 400px; border-radius: 50%; background: radial-gradient(circle, rgba(255,108,12,0.08), transparent 70%); }
.hero-content { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
.hero-inner { max-width: 700px; }
.hero-tag { display: inline-block; padding: 6px 16px; border-radius: 100px; background: rgba(255,108,12,0.2); color: var(--orange); font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 24px; }
.hero h1 { color: white; margin-bottom: 24px; font-size: clamp(40px, 6vw, 64px); }
.hero h1 span { color: var(--orange); }
.hero p { font-size: 18px; line-height: 1.7; color: rgba(255,255,255,0.7); margin-bottom: 40px; max-width: 540px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* --- Announcement Box --- */
.announcement-box {
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 12px;
    padding: 20px 28px;
    margin-bottom: 32px;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(8px);
    max-width: 540px;
}
.announcement-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 8px;
}
.announcement-message {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,0.85);
}

/* --- Stats Bar --- */
.stats-bar { background: white; border-bottom: 1px solid var(--gray-200); }
.stats-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 32px 24px; text-align: center; border-right: 1px solid var(--gray-200); }
.stat:last-child { border-right: none; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; color: var(--orange); }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Event Cards (image-based) --- */
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.events-grid-2col { grid-template-columns: repeat(2, 1fr); }
.event-image { height: 160px; background: linear-gradient(135deg, rgba(255,108,12,0.1), var(--cream)); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.event-image img { width: 100%; height: 100%; object-fit: cover; }
.event-image-placeholder { font-size: 14px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: 0.1em; }
.event-image-lg { height: auto; max-height: 500px; }
.event-image-lg img { width: 100%; height: auto; max-height: 500px; object-fit: contain; }
.event-meta { font-size: 14px; color: var(--gray-500); margin: 8px 0; }
.event-horizontal { display: flex; }
.event-horizontal .event-image { width: 180px; min-height: 180px; flex-shrink: 0; }
.progress-bar { height: 6px; background: var(--gray-200); border-radius: 3px; width: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--orange); }
.progress-fill-danger { background: var(--danger); }

/* --- Event Detail --- */
.event-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }
.event-info-box { padding: 20px; background: var(--off-white); border-radius: 12px; }
.event-info-label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.event-info-value { font-weight: 600; color: var(--gray-900); }
.event-price-big { font-weight: 700; color: var(--orange); font-size: 20px; }

/* --- Event Description (rich text) --- */
.event-description { font-size: 16px; line-height: 1.8; color: var(--gray-700); margin-bottom: 40px; }
.event-description ul, .event-description ol { margin: 12px 0 12px 24px; }
.event-description li { margin-bottom: 6px; }
.event-description a { color: var(--orange); text-decoration: underline; }
.event-description a:hover { color: var(--orange-light); }
.event-description p { margin-bottom: 12px; }
.event-description strong, .event-description b { font-weight: 700; }
.event-description img { max-width: 100%; height: auto; border-radius: 12px; margin: 16px 0; }

/* --- Pricing Table --- */
.pricing-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.pricing-table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); background: var(--gray-50); border-bottom: 2px solid var(--gray-200); }
.pricing-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
.pricing-table .current-level { background: var(--orange-glow); font-weight: 700; }
.pricing-table .price-cell { font-weight: 700; color: var(--orange); }

/* --- Refund Policy --- */
.refund-badge { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.refund-badge-yes { background: #ECFDF5; color: var(--success); }
.refund-badge-no { background: var(--gray-100); color: var(--gray-500); }

/* --- Filter Buttons --- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 36px; flex-wrap: wrap; }
.filter-btn { padding: 8px 20px; border-radius: 100px; border: none; background: white; color: var(--gray-700); font-size: 14px; font-weight: 500; cursor: pointer; font-family: 'DM Sans', sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: all 0.2s; text-decoration: none; }
.filter-btn:hover, .filter-btn.active { background: var(--orange); color: white; box-shadow: 0 4px 12px rgba(255,108,12,0.25); }

/* --- Membership Tiers --- */
.tiers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-bottom: 48px; }
.tier-card { position: relative; cursor: pointer; text-align: center; }
.tier-card.selected { border: 2px solid var(--orange); }
.tier-price { font-size: 36px; font-weight: 700; margin-bottom: 4px; }
.tier-price span { font-size: 16px; font-weight: 400; color: var(--gray-500); }
.tier-price-orange { color: var(--orange); }

/* --- Donate --- */
.donate-presets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.donate-btn { padding: 14px 24px; border-radius: 10px; border: 2px solid var(--gray-200); background: white; color: var(--gray-700); font-size: 16px; font-weight: 700; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; flex: 1; min-width: 80px; text-align: center; }
.donate-btn.active, .donate-btn:hover { border-color: var(--orange); background: var(--orange-glow); color: var(--orange); }

/* --- Payment Box --- */
.payment-box { padding: 16px; background: var(--cream); border-radius: 12px; margin-bottom: 24px; }
.payment-row { display: flex; justify-content: space-between; }
.payment-note { font-size: 12px; color: var(--gray-500); margin-top: 8px; }

/* --- Section Headers --- */
.section-header { margin-bottom: 48px; }
.section-header h2 { margin-bottom: 8px; }
.section-header p { font-size: 16px; color: var(--gray-500); }
.section-header-flex { display: flex; justify-content: space-between; align-items: flex-end; }

/* --- Benefits Grid --- */
.benefits-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 40px; }
.benefit-card { padding: 32px 24px; border-radius: 16px; background: var(--off-white); text-align: center; }
.benefit-icon { font-size: 40px; margin-bottom: 16px; }
.benefit-card h3 { font-size: 16px; margin-bottom: 8px; font-family: 'DM Sans', sans-serif; font-weight: 700; }
.benefit-card p { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

/* --- CTA Section --- */
.cta-section { padding: 80px 24px; text-align: center; background: linear-gradient(160deg, var(--gray-900), #2D1B0E); }
.cta-section h2 { color: white; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.6); font-size: 16px; margin-bottom: 32px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* --- Toast --- */
.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: var(--gray-900); color: white; padding: 14px 28px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 32px rgba(0,0,0,0.3); z-index: 2000; transition: opacity 0.4s; }
.toast-error { background: var(--danger); }
.toast.fade-out { opacity: 0; }

/* --- Footer --- */
.footer { background: var(--gray-900); padding: 60px 24px 32px; color: rgba(255,255,255,0.5); }
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: white; font-weight: 700; font-size: 15px; }
.footer-about p { font-size: 14px; line-height: 1.7; }
.footer h4 { color: white; font-size: 13px; font-weight: 700; font-family: 'DM Sans', sans-serif; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; }
.footer a { display: block; color: rgba(255,255,255,0.5); font-size: 14px; margin-bottom: 10px; text-decoration: none; }
.footer a:hover { color: rgba(255,255,255,0.8); }
.footer p { font-size: 14px; line-height: 1.8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; font-size: 13px; text-align: center; }

/* --- Admin Dashboard --- */
.admin-tabs { display: inline-flex; gap: 4px; background: white; padding: 4px; border-radius: 12px; border: 1px solid var(--gray-200); margin-bottom: 32px; flex-wrap: wrap; }
.admin-tab { padding: 10px 24px; border-radius: 8px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; text-decoration: none; color: var(--gray-700); background: transparent; }
.admin-tab.active, .admin-tab:hover { background: var(--orange); color: white; }
.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-card-label { font-size: 13px; color: var(--gray-500); margin-bottom: 4px; }
.stat-card-icon { font-size: 28px; }

/* --- File Library --- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.file-card { border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; background: white; }
.file-card-thumb { width: 100%; height: 140px; object-fit: cover; display: block; }
.file-card-pdf { width: 100%; height: 140px; display: flex; align-items: center; justify-content: center; background: var(--gray-50); font-size: 48px; }
.file-card-body { padding: 12px; }
.file-card-label { font-size: 13px; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; word-break: break-all; }
.file-card-meta { font-size: 11px; color: var(--gray-500); margin-bottom: 8px; }
.file-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.copy-url-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--gray-200); background: white; color: var(--gray-700); font-size: 11px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.copy-url-btn:hover { border-color: var(--orange); color: var(--orange); }

/* Mini file library on event editor */
.file-mini-library { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; padding: 16px; margin-top: 8px; }
.file-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; }
.file-mini-card { border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; background: white; cursor: pointer; transition: all 0.2s; }
.file-mini-card:hover { border-color: var(--orange); box-shadow: 0 2px 8px rgba(255,108,12,0.15); }
.file-mini-card img { width: 100%; height: 80px; object-fit: cover; display: block; }
.file-mini-card-pdf { width: 100%; height: 80px; display: flex; align-items: center; justify-content: center; background: var(--gray-50); font-size: 28px; }
.file-mini-card-label { padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--gray-700); }

/* Event image selector */
.image-selector { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; max-height: 250px; overflow-y: auto; margin-top: 8px; }
.image-selector-card { border: 2px solid var(--gray-200); border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.2s; }
.image-selector-card:hover { border-color: var(--orange-light); }
.image-selector-card.selected { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-glow); }
.image-selector-card img { width: 100%; height: 70px; object-fit: cover; display: block; }

/* --- Table --- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: var(--gray-50); border-bottom: 2px solid var(--gray-200); }
th { padding: 14px 20px; text-align: left; font-weight: 600; color: var(--gray-700); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 14px 20px; border-bottom: 1px solid var(--gray-100); }
td.name { font-weight: 600; color: var(--gray-900); }
td.muted { color: var(--gray-500); }

/* --- Page Header --- */
.page-header { margin-bottom: 32px; }
.page-header h1 { margin-bottom: 8px; }
.page-header p { font-size: 16px; color: var(--gray-500); }
.back-link { display: inline-block; color: var(--orange); font-size: 14px; font-weight: 600; margin-bottom: 24px; text-decoration: none; }
.back-link:hover { color: var(--orange-light); }

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-orange { color: var(--orange); }
.text-success { color: var(--success); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-row { display: flex; gap: 8px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.max-w-600 { max-width: 600px; margin-left: auto; margin-right: auto; }
.max-w-700 { max-width: 700px; margin-left: auto; margin-right: auto; }
.max-w-900 { max-width: 900px; margin-left: auto; margin-right: auto; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: white; padding: 16px; border-bottom: 1px solid var(--gray-200); gap: 4px; }
    .nav-links.open { display: flex; }
    .mobile-toggle { display: block; }
    .events-grid, .events-grid-2col { grid-template-columns: 1fr; }
    .tiers-grid { grid-template-columns: 1fr; }
    .benefits-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat { border-right: none; }
    .event-info-grid { grid-template-columns: 1fr; }
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .section-header-flex { flex-direction: column; align-items: flex-start; gap: 16px; }
    .event-horizontal { flex-direction: column; }
    .event-horizontal .event-image { width: 100%; height: 140px; }
    .hero { padding: 80px 24px 60px; }
}
