/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f2ff 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 4rem);
}

/* Header Styles */
header {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    color: #1e40af;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

h2 {
    color: #3b82f6;
    margin-top: 1.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #64748b;
    margin: 0;
}

/* Common Card/Section Styles */
.card, .section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.card h2, .section h2 {
    margin-top: 0;
}

/* Common Image Styles */
img {
    max-width: 100%;
    height: auto;
}

.img-rounded {
    border-radius: 8px;
}

.img-shadow {
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* Common Caption/Text Styles */
.caption, .text-muted {
    color: #64748b;
    font-style: italic;
}

.text-center {
    text-align: center;
}

/* Common Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-link {
    background: #dbeafe;
    color: #1e40af;
}

.btn-link:hover {
    background: #bfdbfe;
    transform: translateY(-1px);
}

/* Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1000px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #64748b;
    border-top: 2px solid #cbd5e1;
    margin-top: 2rem;
}

footer a {
    color: #3b82f6;
    text-decoration: none;
}

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

.attribution {
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.hamburger-btn {
    background: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 1.5rem;
    line-height: 1;
}

.hamburger-btn:hover {
    background: #f0f0f0;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    overflow: hidden;
}

.menu-dropdown.show {
    display: block;
}

.menu-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.menu-dropdown a:last-child {
    border-bottom: none;
}

.menu-dropdown a:hover {
    background: #f3f4f6;
}

.menu-dropdown a.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

/* ===========================================
   LANDING PAGE STYLES
   =========================================== */

.quick-guide {
    background: linear-gradient(90deg, #fef3c7 0%, #dbeafe 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.quick-guide h2 {
    color: #92400e;
    margin-top: 0;
}

.guide-item {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.guide-emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.guide-item strong {
    display: block;
    color: #1e40af;
    margin-bottom: 0.25rem;
}

.intro-text p {
    font-size: 1.1rem;
    margin: 1rem 0;
}

/* ===========================================
   FORECASTS PAGE STYLES
   =========================================== */

.forecasts-page h2 {
    border-bottom: 2px solid #93c5fd;
    padding-bottom: 0.5rem;
}

.zip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .zip-grid {
        grid-template-columns: 1fr;
    }
}

.zip-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.zip-card:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.zip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.zip-code {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e40af;
    font-family: monospace;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.zip-card-formats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.format-btn {
    display: block;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid #93c5fd;
}

.format-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.format-btn:active {
    transform: scale(0.98);
}

.no-formats {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.no-zips {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-style: italic;
    background: white;
    border-radius: 12px;
}

/* ===========================================
   GUIDE PAGE STYLES
   =========================================== */

.guide-page h2 {
    margin-top: 2rem;
    border-bottom: 2px solid #93c5fd;
    padding-bottom: 0.5rem;
}

.intro-box {
    border-left: 4px solid #fbbf24;
}

.intro-box p {
    margin: 0.5rem 0;
}

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

.feature-card {
    padding: 1.25rem;
}

.feature-card h3 {
    margin: 0 0 0.75rem 0;
    color: #1e40af;
    font-size: 1.1rem;
}

.feature-card p {
    margin: 0;
    color: #475569;
}

.feature-emoji {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.timeline-explanation {
    background: linear-gradient(90deg, #fef3c7 0%, #dbeafe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.timeline-explanation h3 {
    margin-top: 0;
    color: #92400e;
}

.symbol-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.symbol-table th {
    background: #dbeafe;
    padding: 1rem;
    text-align: left;
    color: #1e40af;
}

.symbol-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.symbol-table tr:last-child td {
    border-bottom: none;
}

.symbol-table tr:nth-child(even) {
    background: #f8fafc;
}

.symbol-name {
    font-weight: 600;
    color: #334155;
}

.fun-fact {
    background: #fef3c7;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    border-left: 4px solid #f59e0b;
}

.fun-fact strong {
    color: #92400e;
}

/* ===========================================
   ADMIN PAGE STYLES
   =========================================== */

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
}

.admin-page table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-page th,
.admin-page td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-page th {
    background: #dbeafe;
    font-weight: 600;
    color: #1e40af;
}

.admin-page tr:last-child td {
    border-bottom: none;
}

.admin-page tr:hover td {
    background: #f0f8ff;
}

.zip-cell {
    font-weight: 600;
    font-family: monospace;
    font-size: 1.1rem;
    color: #1e40af;
}

.format-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.format-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.format-checkbox input {
    cursor: pointer;
}

.format-checkbox input:disabled {
    cursor: not-allowed;
}

.available-cell {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #22c55e;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Admin Buttons */
.btn-generate {
    background: #3b82f6;
    color: white;
}

.btn-generate:hover {
    background: #2563eb;
}

.btn-generate:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-generate.loading {
    background: #f59e0b;
}

.btn-generate.success {
    background: #22c55e;
}

.btn-generate.error {
    background: #ef4444;
}

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #22c55e;
}

.toast.error {
    background: #ef4444;
}

.toast.info {
    background: #3b82f6;
}

/* Add ZIP Form */
.add-zip-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.add-zip-section h2 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: #374151;
}

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

.add-zip-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
    font-family: monospace;
    width: 120px;
}

.add-zip-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-add {
    background: #10b981;
    color: white;
}

.btn-add:hover {
    background: #059669;
}

.btn-add:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}
