:root {
    --wa-dark: #075E54;
    --wa-teal: #128C7E;
    --wa-light-green: #25D366;
    --bg-color: #F0F2F5; 
    --white: #ffffff;
    --error: #d32f2f;
    --primary: #128C7E;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    background-color: var(--bg-color);
    height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    flex-shrink: 0;
    background-color: var(--wa-dark);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
}

.app-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-bottom: 100px !important;
    height: calc(100vh - 70px);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 0.75rem;
    text-decoration: none;
}

.nav-item.active { color: var(--wa-teal); }
.nav-item i { font-size: 1.3rem; margin-bottom: 4px; }

.status-card { 
    background: linear-gradient(135deg, #128C7E, #075E54); 
    color: white; 
    padding: 20px; 
    border-radius: 20px; 
    margin-bottom: 20px; 
}

.list-item { 
    background: white; 
    padding: 15px; 
    border-radius: 15px; 
    margin-bottom: 10px; 
    display: flex; 
    align-items: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}

.item-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 15px;
}

[dir="ltr"] .item-icon { margin-left: 0; margin-right: 15px; }

.dose-icon { background-color: #e8f5e9; color: var(--wa-teal); }
.item-details { flex: 1; }
.item-name { font-weight: 600; color: #333; }
.item-time { font-size: 0.8rem; color: #888; margin-top: 3px; }



.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: flex-end;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 25px 25px 0 0;
    padding: 0;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

/* Specific styling for Medicine Selection Modal */
#med-modal .search-box {
    background: #f1f3f5 !important;
    border: 1px solid #e9ecef;
    border-radius: 15px !important;
    margin: 15px 20px !important;
    padding: 5px 15px !important;
    display: flex;
    align-items: center;
}

#med-modal .search-box input {
    border: none;
    background: none;
    padding: 12px;
    width: 100%;
    outline: none;
}

#med-modal .menu-list {
    padding: 0 20px;
    max-height: 400px;
    overflow-y: auto;
}

#med-modal .menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    cursor: pointer;
}

#med-modal .menu-item:has(input:checked) {
    background: #e0f2f1;
    border-color: var(--wa-teal);
}

#med-modal .med-select {
    width: 20px;
    height: 20px;
    accent-color: var(--wa-teal);
}

.btn-main {
    background: var(--wa-teal);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 15px;
    width: calc(100% - 40px);
    margin: 15px 20px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}

.login-page {
    background: linear-gradient(180deg, var(--wa-dark) 0%, var(--wa-teal) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: 100vh;
}

.login-container {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px 25px;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #f9f9f9;
    outline: none;
}

.input-group input:focus {
    border-color: var(--wa-teal);
    background: white;
}

.switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 24px;
}

.switch input { display: none; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #128C7E; }
input:checked + .slider:before { transform: translateX(21px); }

.error-msg {
    background-color: #ff5252;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: none;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

.admin-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.admin-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #128C7E;
}

/* تنسيق الأزرار الاحترافي */
.btn-main-action {
    background: linear-gradient(135deg, var(--wa-teal), var(--wa-dark));
    color: white;
    border: none;
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(18, 140, 126, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 15px 0;
}

.btn-main-action:active {
    transform: scale(0.96);
    box-shadow: 0 4px 10px rgba(18, 140, 126, 0.2);
}

.btn-main-action i {
    font-size: 1.2rem;
}

/* تنسيق خاص بمدخلات المودال */
.modal-input {
    width: 100%;
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #eee;
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.modal-input:focus {
    border-color: var(--wa-teal);
}