/* Global Styles */
:root {
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --secondary-color: #06B6D4;
    --accent-color: #8B5CF6;
    --text-color: #1F2937;
    --light-text: #6B7280;
    --background: #E6F3FF;
    --accent-bg: #F0F8FF;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --whatsapp-color: #25D366;
    --bg-gradient-1: linear-gradient(135deg, #E6F3FF, #F0F8FF);
    --bg-gradient-2: linear-gradient(135deg, #F0F8FF, #E6F3FF);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: var(--bg-gradient-1);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

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

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.whatsapp-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
}

.whatsapp-status i {
    color: var(--whatsapp-color);
}

/* Subscription Info */
.subscription-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.subscription-status.active {
    color: var(--success-color);
}

.subscription-status.inactive {
    color: var(--danger-color);
}

.subscription-details {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    z-index: 1000;
    margin-top: 0.5rem;
}

.subscription-info:hover .subscription-details {
    display: block;
}

.subscription-details p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .container {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Quick Actions */
.quick-actions {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.action-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 1rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.action-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.action-card span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Reminders Section */
.reminders-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.reminders-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reminder-item {
    background: var(--accent-bg);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reminder-info h4 {
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.reminder-info p {
    color: var(--light-text);
    font-size: 0.9rem;
}

.reminder-time {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Medications Section */
.medications-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.medications-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

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

.medication-card {
    background: var(--accent-bg);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(79, 70, 229, 0.1);
    transition: all 0.3s ease;
}

.medication-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2);
}

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

.medication-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.medication-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: var(--light-text);
}

.medication-details {
    margin-bottom: 1rem;
}

.medication-details p {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

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

.medication-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.medication-btn:hover {
    background: var(--primary-dark);
}

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

.medication-btn.danger:hover {
    background: #dc2626;
}

/* WhatsApp Section */
.whatsapp-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.whatsapp-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.whatsapp-status-card {
    background: var(--accent-bg);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.disconnected {
    background: var(--danger-color);
}

.status-details h3 {
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.status-details p {
    color: var(--light-text);
    font-size: 0.9rem;
}

.whatsapp-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.whatsapp-btn {
    background: var(--whatsapp-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 2rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    width: 100%;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    color: var(--text-color);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--light-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f3f4f6;
    color: var(--danger-color);
}

/* Form Styles */
.medication-form {
    padding: 2rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.cancel-btn {
    background: #f3f4f6;
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #e5e7eb;
}

.save-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: var(--primary-dark);
}

/* WhatsApp Setup Styles */
.whatsapp-setup-content {
    padding: 2rem;
}

.setup-step {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--accent-bg);
    border-radius: 15px;
}

.setup-step h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.setup-step p {
    color: var(--light-text);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.whatsapp-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.verify-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-btn {
    background: var(--whatsapp-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* History Styles */
.history-content {
    padding: 2rem;
}

.history-filters {
    margin-bottom: 1.5rem;
}

.history-filters select {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.9rem;
    background: white;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: var(--accent-bg);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info h4 {
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.history-info p {
    color: var(--light-text);
    font-size: 0.8rem;
}

.history-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-sent {
    background: rgba(37, 211, 102, 0.1);
    color: var(--whatsapp-color);
}

.status-missed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.status-taken {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.toast.hidden {
    display: none;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* WhatsApp Configuration Modal Styles */
.whatsapp-config-content {
    padding: 2rem;
}

.config-section {
    margin-bottom: 2rem;
}

.config-section h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.service-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-option:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.service-option input[type="radio"] {
    margin-top: 0.25rem;
    accent-color: var(--primary-color);
}

.service-info h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.service-info p {
    color: var(--light-text);
    font-size: 0.9rem;
    margin: 0;
}

.setup-instructions {
    background: var(--accent-bg);
    padding: 1rem;
    border-radius: 10px;
}

.instruction-set {
    margin-bottom: 1rem;
}

.instruction-set h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.instruction-set ol {
    color: var(--light-text);
    font-size: 0.9rem;
    padding-left: 1.5rem;
}

.instruction-set li {
    margin-bottom: 0.25rem;
}

.instruction-set a {
    color: var(--primary-color);
    text-decoration: none;
}

.instruction-set a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .container {
        padding: 1rem;
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .whatsapp-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: 90vh;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .save-btn, .cancel-btn {
        width: 100%;
    }
    
    .service-option {
        flex-direction: column;
        gap: 0.5rem;
    }
} 