:root {
    --primary: #2e86de;
    --primary-dark: #1e6fbf;
    --danger: #ee5253;
    --danger-dark: #c23616;
    --warning: #ff9f43;
    --success: #10ac84;
    --success-dark: #0e8d6b;
    --white: #ffffff;
    --light: #f5f6fa;
    --gray: #dfe6e9;
    --dark: #2f3640;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.login-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.login-card h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 134, 222, 0.2);
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--dark);
    font-size: 0.9rem;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--gray);
}

.divider::before {
    margin-right: 1rem;
}

.divider::after {
    margin-left: 1rem;
}

.google-login {
    width: 100%;
    padding: 0.8rem;
    background: var(--white);
    color: var(--dark);
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.google-login:hover {
    background: var(--light);
}

.google-login i {
    margin-right: 8px;
    color: var(--danger);
    font-size: 1.1rem;
}

.signup-text {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--dark);
}

.signup-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.signup-text a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
#dashboard {
    display: none;
}

header {
    display: flex;
    align-items: center;
    background: var(--white);
    color: var(--dark);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-icon {
    font-size: 1.3rem;
    cursor: pointer;
    margin-right: 1rem;
    color: var(--primary);
}

header h1 {
    flex: 1;
    font-size: 1.3rem;
    font-weight: 600;
}

.connection-status {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--success-dark);
}

.connection-status i {
    font-size: 0.5rem;
    margin-right: 5px;
    color: var(--success);
}

.side-menu {
    position: fixed;
    left: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background: var(--white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    padding-top: 4rem;
    z-index: 1000;
}

.side-menu.open {
    left: 0;
}

.side-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    border-bottom: 1px solid var(--light);
    transition: var(--transition);
}

.side-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

.side-menu a.active {
    background: rgba(46, 134, 222, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.side-menu a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.content {
    padding: 1.5rem;
    min-height: calc(100vh - 60px);
}

.welcome-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 2rem auto;
}

.welcome-card img {
    width: 150px;
    height: 150px;
    margin-bottom: 1.5rem;
    object-fit: contain;
}

.welcome-card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.welcome-card p {
    color: var(--dark);
    margin-bottom: 2rem;
    opacity: 0.8;
}

.monitor-btn {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.monitor-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(46, 134, 222, 0.2);
}

/* Health Monitor Styles */
.back-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--primary-dark);
}

.back-btn i {
    margin-right: 5px;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.health-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.health-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.health-card.heart {
    border-top: 4px solid var(--danger);
}

.health-card.oxygen {
    border-top: 4px solid var(--primary);
}

.health-card.pulse {
    border-top: 4px solid var(--warning);
}

.health-card.temp {
    border-top: 4px solid #ff6b6b;
}

.health-card.bp {
    border-top: 4px solid var(--success);
    grid-column: span 2;
}

.card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.health-card.heart .card-icon {
    color: var(--danger);
}

.health-card.oxygen .card-icon {
    color: var(--primary);
}

.health-card.pulse .card-icon {
    color: var(--warning);
}

.health-card.temp .card-icon {
    color: #ff6b6b;
}

.health-card.bp .card-icon {
    color: var(--success);
}

.card-label {
    font-size: 0.9rem;
    color: var(--dark);
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.card-unit {
    font-size: 0.8rem;
    color: var(--dark);
    opacity: 0.6;
}

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-weight: 500;
    background: rgba(16, 172, 132, 0.1);
    color: var(--success-dark);
}

.status i {
    margin-right: 8px;
}

.status.alert {
    background: rgba(238, 82, 83, 0.1);
    color: var(--danger-dark);
    animation: pulse 1.5s infinite;
}

.alert-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.alert-btn {
    padding: 0.8rem 1.5rem;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.alert-btn:hover {
    background: var(--danger-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(238, 82, 83, 0.2);
}

.alert-btn i {
    margin-right: 8px;
}

.last-alert {
    font-size: 0.8rem;
    color: var(--dark);
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.last-alert i {
    margin-right: 5px;
}

/* Voice & Time Detection Styles */
.voice-time-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.voice-card, .time-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.voice-card h2, .time-card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.voice-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.voice-status {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.voice-status.idle {
    background: rgba(227, 242, 253, 0.1);
    color: #90caf9;
}

.voice-status.listening {
    background: rgba(255, 248, 225, 0.1);
    color: #ffcc80;
}

.voice-status.error {
    background: rgba(255, 235, 238, 0.1);
    color: #ef9a9a;
}

.log-container {
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.mode-box {
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    margin: 1rem 0;
    transition: all 0.5s ease;
}

.night {
    background: #1e293b;
    color: white;
}

.day {
    background: #fbbf24;
    color: black;
}

.alert-message {
    background: rgba(185, 28, 28, 0.2);
    color: #fca5a5;
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 4px solid #b91c1c;
    margin-bottom: 0.5rem;
}

.success-message {
    background: rgba(167, 243, 208, 0.2);
    color: #86efac;
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
    margin-bottom: 0.5rem;
}

/* Activity Monitoring Styles */
.activity-card {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.activity-card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.activity-stats {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray);
    color: var(--primary);
}

.activity-story {
    font-size: 1rem;
    line-height: 1.6;
}

/* History Page Styles */
.history-item {
    background: var(--white);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.history-item h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.history-item p {
    color: var(--dark);
}

/* Settings Page Styles */
.settings-form {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
}

.save-btn {
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.save-btn:hover {
    background: var(--primary-dark);
}

/* Medication System Styles */
.medication-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.medication-card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.medication-form input,
.medication-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
}

.medication-form input:focus {
    border-color: var(--primary);
    outline: none;
}

.time-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.medication-form button {
    padding: 0.8rem 1.5rem;
    margin-right: 0.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.medication-form button[type="submit"] {
    background: var(--primary);
    color: var(--white);
}

.medication-form button[type="button"] {
    background: var(--danger);
    color: var(--white);
}

.medication-form button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.medicine-list {
    background: var(--white);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    min-height: 100px;
}

.medicine-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.medicine-item:last-child {
    border-bottom: none;
}

.medicine-name {
    font-weight: 600;
    color: var(--primary);
}

.medicine-times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.time-badge {
    background: rgba(46, 134, 222, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.delete-btn {
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.schedule-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-time {
    font-weight: 600;
    color: var(--primary);
}

.mark-btn {
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Video Call System Styles */
.video-section {
    background: var(--white);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.video-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.video-container video {
    width: 45%;
    min-width: 300px;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.video-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.video-controls button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-controls .btn-primary {
    background: var(--primary);
    color: var(--white);
}

.video-controls .btn-danger {
    background: var(--danger);
    color: var(--white);
}

.video-controls .btn-secondary {
    background: var(--warning);
    color: var(--white);
}

.video-controls button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.connection-settings {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
}

.connection-settings h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-info {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.user-id-display {
    background: rgba(46, 134, 222, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: monospace;
    display: inline-block;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 134, 222, 0.2);
    outline: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .health-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .health-card.bp {
        grid-column: span 2;
    }
    
    .side-menu {
        width: 220px;
        left: -220px;
    }

    .time-inputs {
        grid-template-columns: 1fr 1fr;
    }

    .video-container video {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .health-grid {
        grid-template-columns: 1fr;
    }
    
    .health-card.bp {
        grid-column: span 1;
    }

    .time-inputs {
        grid-template-columns: 1fr;
    }

    .video-controls {
        flex-direction: column;
    }

    .video-controls button {
        width: 100%;
        justify-content: center;
    }
}