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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #fff;
}

.medication-card {
    background: #16213e;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 2px solid #0f3460;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.medication-card.available {
    border-color: #4ecca3;
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.3);
}

.medication-card.alerting {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(78, 204, 163, 0.3); }
    50% { box-shadow: 0 0 40px rgba(78, 204, 163, 0.6); }
}

.medication-card h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #e94560;
}

#tylenol-card h2 {
    color: #4fc3f7;
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: center;
    padding: 20px 0;
    color: #fff;
}

.timer.available {
    color: #4ecca3;
    font-size: 1.8rem;
}

.timer.scheduled {
    color: #f39c12;
}

.medication-card.scheduled {
    border-color: #f39c12;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.2);
}

.last-taken {
    text-align: center;
    color: #888;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:hover {
    transform: scale(1.02);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #e94560;
    color: white;
}

#tylenol-card .btn-primary {
    background: #4fc3f7;
    color: #1a1a2e;
}

.btn-secondary {
    background: #0f3460;
    color: #ccc;
}

.btn-danger {
    background: #c0392b;
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.history-section {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
}

.history-section h3 {
    margin-bottom: 15px;
    color: #aaa;
    font-size: 1rem;
}

#history-list {
    list-style: none;
    margin-bottom: 15px;
}

#history-list li {
    padding: 8px 0;
    border-bottom: 1px solid #0f3460;
    color: #ccc;
    font-size: 0.9rem;
}

#history-list li:last-child {
    border-bottom: none;
}

#history-list .ibuprofen {
    border-left: 3px solid #e94560;
    padding-left: 10px;
}

#history-list .tylenol {
    border-left: 3px solid #4fc3f7;
    padding-left: 10px;
}

#history-list .scheduled {
    color: #f39c12;
    font-style: italic;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #16213e;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-content p {
    margin-bottom: 20px;
    color: #ccc;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #0f3460;
    border-radius: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 20px;
}

.modal-content input:focus {
    outline: none;
    border-color: #4ecca3;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Mobile responsiveness */
@media (max-width: 400px) {
    .timer {
        font-size: 2.5rem;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
