:root {
    --primary: #ff6b6b;
    --primary-dark: #ee5a52;
    --secondary: #4ecdc4;
    --accent: #ffe66d;
    --success: #95e1d3;
    --warning: #ffa07a;
    --danger: #ff6b6b;
    --dark: #2d3436;
    --light: #fff4e6;
    --white: #ffffff;
    --travel-blue: #74b9ff;
    --sunset: #ff9ff3;
    --forest: #55efc4;
    --sky: #a8e6cf;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffeaa7 0%, #74b9ff 50%, #a29bfe 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
}

/* ============== MOBILE-FIRST LAYOUT ============== */

.app-container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.family-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.3);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px; /* Space for bottom nav */
}

/* Calendar Container */
.calendar-container {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.month-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.month-title {
    font-size: 24px;
    font-weight: 700;
    min-width: 200px;
    text-align: center;
}

.nav-btn {
    background: var(--light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.nav-btn:active {
    transform: scale(0.95);
    background: var(--primary);
    color: var(--white);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-header {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    padding: 10px 0;
    font-size: 14px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid var(--light);
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.calendar-day.has-event {
    background: var(--success);
    color: var(--white);
    font-weight: 700;
}

.calendar-day:active {
    transform: scale(0.95);
}

.day-number {
    font-size: 16px;
    font-weight: 600;
}

.event-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 4px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.action-btn {
    background: var(--white);
    border: 2px solid var(--light);
    padding: 20px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-btn:active {
    transform: scale(0.97);
    border-color: var(--primary);
}

.action-icon {
    font-size: 28px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 8px 20px 20px;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    z-index: 100;
    border-top: 1px solid #e5e7eb;
}

/* Add padding to main content to prevent bottom nav from covering it */
.main-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px; /* Space for bottom nav */
}

.app-container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    text-decoration: none;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #fd79a8);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: linear-gradient(135deg, #4ecdc4, #55efc4);
    color: white;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.btn-secondary:active {
    transform: scale(0.97);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    color: var(--dark);
}

/* Modal/Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
}

.modal-overlay.active {
    display: block;
}

.modal-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 201;
    transition: bottom 0.3s ease;
}

.modal-sheet.active {
    bottom: 0;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--light);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    min-height: 120px;
    resize: vertical;
}

/* iPad Specific */
@media (min-width: 768px) {
    .app-container {
        max-width: 1024px;
        margin: 0 auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .calendar-grid {
        gap: 12px;
    }
    
    .calendar-day {
        padding: 12px;
    }
    
    .main-content {
        padding: 30px;
    }
    
    .bottom-nav {
        position: relative;
        box-shadow: none;
        border-top: none;
        margin-top: 30px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .bottom-nav {
        display: flex;
        justify-content: center;
        gap: 20px;
    }
    
    .nav-item {
        flex-direction: row;
        gap: 8px;
        padding: 12px 24px;
        font-size: 14px;
    }
}
