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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #4a5568;
    font-size: 2rem;
    font-weight: 700;
}

.lang-toggle {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-toggle:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.main-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.nav-btn:hover {
    transform: translateY(-2px);
}

.add-medication {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.add-medication h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.875rem;
    color: #718096;
    font-style: italic;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.medications-list {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.medications-list h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.medication-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.medication-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.medication-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.medication-card.expired {
    border-color: #fc8181;
    background: #fed7d7;
}

.medication-card.upcoming {
    border-color: #68d391;
    background: #f0fff4;
}

.medication-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.medication-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

.medication-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-upcoming {
    background: #68d391;
    color: white;
}

.status-expired {
    background: #fc8181;
    color: white;
}

.medication-details {
    color: #4a5568;
    margin-bottom: 15px;
}

.medication-actions {
    display: flex;
    gap: 10px;
}

.btn-calendar {
    background: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-calendar:hover {
    background: #3367d6;
}

.btn-delete {
    background: #fc8181;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #f56565;
}

.no-medications {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 40px;
}

/* RTL/LTR Support */
[dir="ltr"] .container {
    direction: ltr;
}

[dir="ltr"] .medication-header {
    flex-direction: row;
}

[dir="rtl"] .medication-header {
    flex-direction: row-reverse;
}

/* Notification Permission Banner */
.notification-banner {
    background: #fed7d7;
    border: 2px solid #fc8181;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-banner.hidden {
    display: none;
}

.banner-text {
    color: #c53030;
    font-weight: 600;
}

.btn-enable {
    background: #fc8181;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .add-medication, .medications-list {
        padding: 20px;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
    
    .medication-actions {
        flex-direction: column;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-actions {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
    }
}

/* Section Visibility */
.hidden {
    display: none !important;
}

/* Dashboard Styles */
.dashboard-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2 {
    color: #4a5568;
    font-size: 1.8rem;
    margin: 0;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

.btn-export, .btn-import {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-import {
    background: #4299e1;
}

.btn-export:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-import:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #667eea;
    color: white;
}

.stat-icon.upcoming {
    background: #48bb78;
}

.stat-icon.expired {
    background: #f56565;
}

.stat-icon.today {
    background: #ed8936;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-label {
    color: #718096;
    font-weight: 600;
    font-size: 0.9rem;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.chart-wrapper {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weekly-chart {
    display: flex;
    justify-content: space-between;
    align-items: end;
    height: 200px;
    padding: 20px 0;
}

.day-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.bar {
    width: 30px;
    background: #667eea;
    border-radius: 4px 4px 0 0;
    min-height: 10px;
    transition: all 0.3s ease;
}

.bar:hover {
    background: #5a67d8;
}

.day-label {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 600;
}

.quick-actions {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quick-actions h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}