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

:root {
    --primary-color: #FF8C42;
    --secondary-color: #4ECDC4;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --border-radius: 16px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 80px;
}

.main-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid #E0E0E0;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    padding: 8px 20px;
    transition: all 0.3s ease;
}

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

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

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

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

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

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

.btn-secondary {
    background: #E0E0E0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #D0D0D0;
}

.error-message {
    background: #FFE5E5;
    color: #D32F2F;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Today Page */
.today-container {
    padding-top: 20px;
}

.today-header {
    text-align: center;
    margin-bottom: 30px;
}

.today-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.today-header p {
    color: var(--text-light);
    font-size: 16px;
}

.medication-card {
    background: linear-gradient(135deg, #FF8C42 0%, #FF6B35 100%);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.medication-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.medication-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.medication-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.fed-status {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.fed-checkmark {
    font-size: 60px;
    margin-bottom: 16px;
}

.fed-status p {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.fed-time {
    color: var(--text-light);
    font-size: 14px;
}

/* iOS-style Slider */
.slider-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 8px;
    box-shadow: var(--shadow);
}

.slider-track {
    position: relative;
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    border-radius: 12px;
    height: 60px;
    overflow: hidden;
}

.slider-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.slider-arrow {
    margin-right: 8px;
    font-size: 20px;
}

.slider-button {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 52px;
    height: 52px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.slider-button:active {
    cursor: grabbing;
}

.slider-icon {
    font-size: 24px;
    color: var(--primary-color);
}

/* Calendar Page */
.calendar-container {
    padding-top: 20px;
}

.calendar-header {
    text-align: center;
    margin-bottom: 30px;
}

.calendar-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.calendar-header p {
    color: var(--text-light);
    font-size: 16px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.history-item.today {
    border: 2px solid var(--primary-color);
}

.history-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 10px;
}

.history-content {
    flex: 1;
}

.history-date {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.history-medication {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.history-status {
    font-size: 14px;
}

.history-status.fed {
    color: #4CAF50;
}

.history-status.pending {
    color: var(--text-light);
}

.loading, .no-history, .error {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Settings Page */
.settings-container {
    padding-top: 20px;
}

.settings-header {
    text-align: center;
    margin-bottom: 30px;
}

.settings-header h1 {
    font-size: 32px;
}

.settings-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.settings-section {
    padding: 24px;
    border-bottom: 1px solid #E0E0E0;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.settings-item label {
    font-weight: 500;
    color: var(--text-dark);
}

.settings-value {
    color: var(--text-light);
    font-size: 14px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.notification-status {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.notification-status.success {
    background: #E8F5E9;
    color: #2E7D32;
}

.notification-status.error {
    background: #FFEBEE;
    color: #C62828;
}

.notification-status.warning {
    background: #FFF3E0;
    color: #E65100;
}

/* Responsive */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .medication-card {
        padding: 40px 20px;
    }
    
    .medication-icon {
        font-size: 60px;
    }
    
    .medication-card h2 {
        font-size: 24px;
    }
}
