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

:root {
    --primary-color: #4a90e2;
    --success-color: #5cb85c;
    --warning-color: #f0ad4e;
    --danger-color: #d9534f;
    --light-gray: #f5f7fa;
    --medium-gray: #e1e8ed;
    --dark-gray: #657786;
    --text-color: #14171a;
    --white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
}

.nav-logo {
    height: 60px;
    width: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(74, 144, 226, 0.3));
}

.live-clock {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    background: var(--light-gray);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 0.1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

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

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.stat-card h3 {
    color: var(--dark-gray);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.quick-actions {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quick-actions h3 {
    margin-bottom: 1rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #357abd;
}

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

.btn-success:hover {
    background-color: #4cae4c;
}

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

.btn-danger:hover {
    background-color: #c9302c;
}

.btn-secondary {
    background-color: var(--medium-gray);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #d0d8de;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.form-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

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

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--dark-gray);
    font-size: 0.85rem;
}

.item-list {
    display: grid;
    gap: 1rem;
}

.item-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.item-card.completed {
    border-left-color: var(--success-color);
    opacity: 0.8;
}

.item-card.missed {
    border-left-color: var(--danger-color);
}

.item-card.pending {
    border-left-color: var(--warning-color);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.item-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.item-details {
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.item-details p {
    margin-bottom: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background-color: var(--success-color);
    color: var(--white);
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--white);
}

.badge-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.message-box {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-width: 400px;
}

.message-box.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.message-box.success {
    background-color: var(--success-color);
    color: var(--white);
}

.message-box.error {
    background-color: var(--danger-color);
    color: var(--white);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .item-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .item-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .item-actions .btn {
        flex: 1;
    }
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--medium-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-weekday {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-day {
    background-color: var(--white);
    min-height: 120px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.calendar-day.empty {
    background-color: var(--light-gray);
}

.calendar-day.today {
    background-color: #fff9e6;
    border: 2px solid var(--warning-color);
}

.day-number {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.day-activities {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    flex: 1;
}

.activity-item {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.2;
}

.activity-item.completed {
    background-color: #d4edda;
    color: #155724;
}

.activity-item.pending {
    background-color: #fff3cd;
    color: #856404;
}

.activity-item.missed {
    background-color: #f8d7da;
    color: #721c24;
}

.activity-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .calendar-day {
        min-height: 80px;
        font-size: 0.85rem;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .activity-item {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

/* In-App Notification Popup */
.in-app-notification {
    position: fixed;
    top: -600px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(102, 126, 234, 0.5);
    z-index: 10000;
    transition: top 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: pulse 2s ease-in-out infinite;
}

.in-app-notification.show {
    top: 80px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(102, 126, 234, 0.8);
    }
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    color: white;
}

.notification-icon {
    font-size: 2.5rem;
    margin-right: 15px;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.notification-body {
    flex: 1;
}

.notification-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-message {
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.95;
}

.notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    line-height: 1;
    padding: 0;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.notification-action-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.notification-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.notification-action-btn.btn-take {
    background: #5cb85c;
    color: white;
}

.notification-action-btn.btn-take:hover {
    background: #4cae4c;
}

.notification-action-btn.btn-skip {
    background: #f0ad4e;
    color: white;
}

.notification-action-btn.btn-skip:hover {
    background: #ec971f;
}

.notification-action-btn.btn-missed {
    background: #d9534f;
    color: white;
}

.notification-action-btn.btn-missed:hover {
    background: #c9302c;
}

.notification-action-btn.btn-untake {
    background: #17a2b8;
    color: white;
}

.notification-action-btn.btn-untake:hover {
    background: #138496;
}

.notification-action-btn.btn-postpone {
    background: #6c757d;
    color: white;
}

.notification-action-btn.btn-postpone:hover {
    background: #5a6268;
}

.notification-action-btn.btn-postpone-option {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-size: 0.85rem;
    padding: 8px 12px;
}

.notification-action-btn.btn-postpone-option:hover {
    background: #ffffff;
    color: #764ba2;
}

@media (max-width: 768px) {
    .in-app-notification {
        right: 10px;
        left: 10px;
        width: auto;
    }
    
    .in-app-notification.show {
        top: 70px;
    }
    
    .notification-icon {
        font-size: 2rem;
    }
    
    .notification-title {
        font-size: 1rem;
    }
    
    .notification-message {
        font-size: 0.9rem;
    }
}
