/* ============================================
   NEW HOPE SHELTER - MOBILE-FIRST PWA STYLES
   Light Purple Theme
   ============================================ */

/* CSS VARIABLES */
:root {
    /* Brand Colors - Light Purple Theme */
    --primary-color: #9b7ab7;
    --primary-dark: #7a5a94;
    --primary-light: #b99dd1;
    --secondary-color: #f57c00;
    --secondary-dark: #e65100;
    --secondary-light: #ff9800;
    
    /* Background Colors */
    --bg-primary: #f3eef8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    
    /* Semantic Colors */
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    --black: #000000;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', 'Inter', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Z-index */
    --z-loading: 10000;
    --z-modal: 9000;
    --z-nav: 8000;
    --z-overlay: 7500;
    --z-floating: 6000;
}

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* LOADING SCREEN */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: pulse 2s ease-in-out infinite;
}

.loading-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* TOP NAVIGATION */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: var(--z-nav);
}

.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: var(--spacing-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.logo i {
    font-size: 1.5rem;
}

.nav-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: var(--spacing-sm);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius-full);
    min-width: 16px;
    text-align: center;
}

/* SIDE NAVIGATION */
.side-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: calc(var(--z-nav) + 10);
    transition: left 0.3s ease;
    overflow-y: auto;
}

.side-nav.active {
    left: 0;
}

.side-nav-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--spacing-xl) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-info {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.user-details p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.3rem;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.side-nav-menu {
    padding: var(--spacing-md) 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
}

/* OVERLAY */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* MAIN CONTENT */
.main-content {
    margin-top: 60px;
    margin-bottom: 70px;
    padding: var(--spacing-md);
    min-height: calc(100vh - 130px);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--spacing-2xl) var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: var(--spacing-xl);
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* SECTIONS */
.section {
    margin-bottom: var(--spacing-xl);
}

.section-header {
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* CARDS */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-md);
}

.card h2,
.card h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.card ul {
    list-style: none;
    padding-left: 0;
}

.card ul li {
    padding: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
    position: relative;
}

.card ul li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* CAMPAIGN CARD */
.campaign-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.campaign-card.featured {
    border: 3px solid var(--primary-color);
}

.campaign-image {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

.campaign-content {
    padding: var(--spacing-lg);
}

.campaign-content h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.campaign-content p {
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
}

.progress-bar {
    height: 12px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.campaign-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
}

/* TABLES */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.schedule-table thead {
    background: var(--primary-color);
    color: white;
}

.schedule-table th,
.schedule-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.schedule-table tbody tr:hover {
    background: var(--bg-primary);
}

.schedule-table strong {
    color: var(--primary-color);
}

.schedule-table small {
    color: var(--gray-500);
}

/* EVENTS */
.events-grid {
    display: grid;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.event-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: var(--spacing-lg);
}

.event-date {
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    min-width: 70px;
}

.event-date .month {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.event-details h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.event-details p {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-xs);
}

.event-card-full {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.event-date-large {
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    min-width: 90px;
}

.event-date-large .month {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.event-date-large .day {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin: var(--spacing-sm) 0;
}

.event-date-large .year {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

.event-info h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.event-description {
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* FORMS */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(155, 122, 183, 0.1);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* AMOUNT SELECTION */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.amount-btn {
    padding: var(--spacing-lg);
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.amount-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.impact-message {
    background: var(--bg-primary);
    border-left: 4px solid var(--primary-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    color: var(--gray-700);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-block {
    width: 100%;
}

/* ALERTS */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    color: var(--info);
    border-left: 4px solid var(--info);
}

.alert i {
    margin-top: 0.2rem;
}

/* INFO BOX */
.info-box {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--primary-color);
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.info-box p {
    margin-bottom: var(--spacing-sm);
}

.info-box a {
    color: var(--primary-color);
    font-weight: 600;
}

/* PAGE HEADER */
.page-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.page-header p {
    color: var(--gray-600);
    font-size: 1.05rem;
}

/* BOTTOM NAVIGATION */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-nav);
    padding: 0 var(--spacing-sm);
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.75rem;
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn i {
    font-size: 1.5rem;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-btn span {
    font-weight: 500;
}

/* FOOTER */
.contact-footer {
    background: white;
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    margin-top: var(--spacing-2xl);
    border-top: 3px solid var(--primary-color);
}

.contact-info h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.contact-info p {
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-note {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* RESPONSIVE DESIGN */
@media (min-width: 640px) {
    .amount-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .main-content {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 960px;
    }
}

/* ACCESSIBILITY */
.btn:focus,
.form-input:focus,
.nav-btn:focus,
.amount-btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* PRINT STYLES */
@media print {
    .top-nav,
    .side-nav,
    .bottom-nav,
    .overlay,
    .loading-screen {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
}
