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

:root {
    --primary: #3B82F6;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg-gradient: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 50%, #FEF3C7 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: #1F2937;
}

.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.home-icon {
    width: 60px;
    height: 60px;
    color: var(--primary);
}

.login-container h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #1F2937;
}

.subtitle {
    text-align: center;
    color: #6B7280;
    margin-bottom: 2rem;
}

.family-list {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.family-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.family-item:hover {
    border-color: #D1D5DB;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.family-item span {
    font-weight: 600;
    color: #1F2937;
}

.family-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.family-item:hover .family-dot {
    transform: scale(1.3);
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
}

.header-info h2 {
    font-size: 1.25rem;
    margin-bottom: 0.125rem;
}

.header-info p {
    font-size: 0.875rem;
    color: #6B7280;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    width: 28px;
    height: 28px;
    color: #6B7280;
}

.notification-bell svg {
    width: 100%;
    height: 100%;
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    font-weight: bold;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: #2563EB;
}

.btn-success {
    background: var(--success);
    color: white;
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
}

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

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: #6B7280;
}

.btn-icon:hover {
    background: #F3F4F6;
}

.btn-large {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

/* Main Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Statistics */
.stats-section {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.stats-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-title svg {
    width: 24px;
    height: 24px;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.stat-card.winner {
    border-color: #FCD34D;
}

.stat-winner-badge {
    font-size: 0.625rem;
    font-weight: bold;
    color: #FCD34D;
    margin-bottom: 0.25rem;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stat-header span {
    font-weight: 500;
}

.stat-header svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.stat-priority {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    background: rgba(252, 211, 77, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Timeline */
.timeline-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #E5E7EB;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-title svg {
    width: 20px;
    height: 20px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #F9FAFB;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.timeline-item-content {
    flex: 1;
}

.timeline-family {
    font-weight: 500;
}

.timeline-dates {
    font-size: 0.875rem;
    color: #6B7280;
}

.timeline-days {
    font-size: 0.875rem;
    color: #6B7280;
    white-space: nowrap;
}

/* Notifications */
.notifications-section {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.notification-title {
    font-weight: 600;
    color: #78350F;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-title svg {
    width: 20px;
    height: 20px;
}

.notification-item {
    background: white;
    border: 1px solid #FDE68A;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.notification-text {
    font-weight: 500;
}

.notification-date {
    font-size: 0.875rem;
    color: #6B7280;
}

.notification-time {
    font-size: 0.75rem;
    color: #D97706;
    font-weight: 500;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.notification-actions .btn {
    flex: 1;
}

/* Booking Form */
.booking-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #E5E7EB;
}

.booking-form {
    margin-top: 1rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Calendar */
.calendar-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #E5E7EB;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.calendar-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.view-toggle {
    display: flex;
    background: #F3F4F6;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #6B7280;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle button.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

#calendarTitle {
    font-size: 1.25rem;
    font-weight: bold;
}

/* Year View */
.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.month-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 180px;
}

.month-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.month-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.month-bookings {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.month-booking {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.booking-family {
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.booking-days {
    color: #6B7280;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* Month View */
.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-day-header {
    background: #F9FAFB;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    border-bottom: 1px solid #E5E7EB;
}

.calendar-day {
    min-height: 100px;
    padding: 0.25rem;
    border: 1px solid #E5E7EB;
    background: white;
}

.calendar-day.today {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.day-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.day-bookings {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.day-booking {
    font-size: 0.625rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
    }

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

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

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