/* Base Styles */
:root {
    --primary-color: #6366f1;
    --primary-light: #e0e7ff;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --secondary-light: #fce7f3;
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-color-dark: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    --font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    --button-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
    --button-hover-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
  }
  
  .dark-theme {
    --primary-color: #818cf8;
    --primary-light: #312e81;
    --primary-dark: #6366f1;
    --secondary-color: #f472b6;
    --secondary-light: #831843;
    --accent-color: #a78bfa;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-color-dark: rgba(0, 0, 0, 0.5);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    --card-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
  
  body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overscroll-behavior-y: contain;
    letter-spacing: 0.01em;
  }
  
  /* Utility Classes */
  .hidden {
    display: none !important;
  }
  
  .btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    width: 100%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--button-shadow);
    position: relative;
    overflow: hidden;
  }
  
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--button-hover-shadow);
  }
  
  .btn-primary:active {
    transform: translateY(0);
  }
  
  /* Add ripple effect to buttons */
  .btn-primary::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
  }
  
  .btn-primary:focus:not(:active)::after {
    animation: ripple 1s ease-out;
  }
  
  @keyframes ripple {
    0% {
      transform: scale(0, 0);
      opacity: 0.5;
    }
    20% {
      transform: scale(25, 25);
      opacity: 0.3;
    }
    100% {
      opacity: 0;
      transform: scale(40, 40);
    }
  }
  
  .btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
  }
  
  .btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-1px);
  }
  
  .btn-secondary::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
  }
  
  .btn-secondary:focus:not(:active)::after {
    animation: ripple-dark 1s ease-out;
  }
  
  @keyframes ripple-dark {
    0% {
      transform: scale(0, 0);
      opacity: 0.3;
    }
    20% {
      transform: scale(25, 25);
      opacity: 0.2;
    }
    100% {
      opacity: 0;
      transform: scale(40, 40);
    }
  }
  
  .btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
  }
  
  .btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
  }
  
  .btn-icon {
    background: var(--gradient-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: var(--button-shadow);
  }
  
  .btn-icon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--button-hover-shadow);
  }
  
  .badge {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
  }
  
  .badge.warning {
    background-color: var(--warning-color);
    color: white;
  }
  
  /* Update Notification Styling */
  .update-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    border-left: 4px solid var(--primary-color);
    animation: slide-in 0.5s ease forwards;
  }
  
  .update-notification.active {
    display: block !important;
    animation: slide-in 0.5s ease forwards;
  }
  
  @keyframes slide-in {
    0% {
      transform: translate(-50%, -100%);
      opacity: 0;
    }
    100% {
      transform: translate(-50%, 0);
      opacity: 1;
    }
  }
  
  .update-notification h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .update-notification h3::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 8px;
  }
  
  .update-notification p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
  }
  
  .update-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }
  
  /* Improved Update Now Button */
  #update-now {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 120px;
  }
  
  #update-now:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  }
  
  #update-now:active {
    transform: translateY(0) scale(0.98);
  }
  
  #update-now::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: 0.5s;
  }
  
  #update-now:hover::before {
    left: 100%;
  }
  
  #update-later {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  #update-later:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
  }
  
  /* Onboarding Screen */
  .screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-color);
  }
  
  .onboarding-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
  }
  
  .logo-container {
    margin-bottom: 40px;
  }
  
  .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
  }
  
  .logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    animation: pulse 2s infinite;
  }
  
  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    70% {
      box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
  }
  
  .logo-icon i {
    font-size: 40px;
    color: white;
  }
  
  .logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
  }
  
  .tagline {
    color: var(--text-secondary);
    font-size: 16px;
  }
  
  .onboarding-slider {
    position: relative;
    margin-bottom: 40px;
    height: 200px;
  }
  
  .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .slide.active {
    opacity: 1;
    transform: translateY(0);
  }
  
  .slide-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
  }
  
  .slide-icon i {
    font-size: 30px;
    color: var(--primary-color);
  }
  
  .slide h2 {
    font-size: 24px;
    margin-bottom: 8px;
  }
  
  .slide p {
    color: var(--text-secondary);
  }
  
  .slide-indicators {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
  }
  
  .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border-color);
    transition: all 0.3s ease;
  }
  
  .indicator.active {
    width: 24px;
    border-radius: 4px;
    background-color: var(--primary-color);
  }
  
  .onboarding-form {
    width: 100%;
  }
  
  .input-group {
    margin-bottom: 20px;
    text-align: left;
  }
  
  .input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
  }
  
  .input-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: all var(--transition-speed);
    border: 1px solid transparent;
  }
  
  .input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
  }
  
  .input-container i {
    position: absolute;
    left: 16px;
    color: var(--text-tertiary);
    font-size: 16px;
  }
  
  .input-container input,
  .input-container textarea {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: none;
    background-color: transparent;
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font-family);
  }
  
  .input-container input:focus,
  .input-container textarea:focus {
    outline: none;
  }
  
  .select-container select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: none;
    background-color: transparent;
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font-family);
    appearance: none;
    cursor: pointer;
  }
  
  .select-container::after {
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 16px;
    color: var(--text-tertiary);
    pointer-events: none;
  }
  
  .toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .toggle-group label {
    margin-bottom: 0;
  }
  
  /* Main App Styles */
  #app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    background-color: var(--bg-color);
  }
  
  /* Top Bar */
  .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  
  .user-info {
    display: flex;
    align-items: center;
  }
  
  .user-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
    overflow: hidden;
  }
  
  .user-avatar span {
    font-size: 18px;
    font-weight: 600;
    color: white;
  }
  
  .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .user-name-container p {
    font-size: 12px;
    color: var(--text-tertiary);
  }
  
  .user-name-container h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
  }
  
  .actions {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  .time-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 16px;
  }
  
  .notification-icon {
    position: relative;
    cursor: pointer;
  }
  
  .notification-icon i {
    font-size: 24px;
    color: var(--text-secondary);
  }
  
  .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--secondary-color);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Content Area */
  .content-area {
    flex: 1;
    padding: 0 20px 80px;
    overflow-y: auto;
  }
  
  .app-screen {
    display: none;
    padding-bottom: 20px;
  }
  
  .app-screen.active {
    display: block;
    animation: fade-in 0.3s ease;
  }
  
  @keyframes fade-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
  }
  
  .screen-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .section {
    margin-bottom: 24px;
    animation: fade-in 0.5s ease;
  }
  
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }
  
  .section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
  }
  
  /* Date Banner */
  .date-banner {
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
    position: relative;
    overflow: hidden;
  }
  
  .date-banner::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1));
    transform: skewX(-15deg);
  }
  
  .date-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
  }
  
  .date-info p {
    font-size: 14px;
    opacity: 0.9;
  }
  
  /* Dashboard Styles */
  .medication-timeline {
    margin-bottom: 20px;
  }
  
  .timeline-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 3px solid var(--primary-color);
  }
  
  .timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
  }
  
  .timeline-item.taken {
    border-left-color: var(--success-color);
  }
  
  .timeline-time {
    width: 60px;
    text-align: center;
    margin-right: 16px;
  }
  
  .timeline-time h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
  }
  
  .timeline-time p {
    font-size: 12px;
    color: var(--text-tertiary);
  }
  
  .timeline-info {
    flex: 1;
  }
  
  .timeline-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
  }
  
  .timeline-info p {
    font-size: 14px;
    color: var(--text-secondary);
  }
  
  .timeline-action {
    margin-left: 16px;
  }
  
  .timeline-action button {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
  }
  
  .timeline-action button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
  }
  
  .timeline-action .taken-btn {
    background-color: var(--success-color);
    color: white;
    opacity: 0.8;
    cursor: default;
  }
  
  .medication-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }
  
  .stat-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
  }
  
  .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--gradient-primary);
  }
  
  .stat-icon i {
    font-size: 20px;
    color: white;
  }
  
  .stat-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
  }
  
  .stat-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .low-stock-container {
    margin-bottom: 24px;
  }
  
  .low-stock-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--warning-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .low-stock-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
  }
  
  .low-stock-icon {
    width: 40px;
    height: 40px;
    background-color: #fff7ed;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
  }
  
  .low-stock-icon i {
    font-size: 20px;
    color: var(--warning-color);
  }
  
  .low-stock-info {
    flex: 1;
  }
  
  .low-stock-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
  }
  
  .low-stock-info p {
    font-size: 14px;
    color: var(--text-secondary);
  }
  
  .low-stock-action {
    margin-left: 16px;
  }
  
  .low-stock-action button {
    background-color: var(--warning-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
  }
  
  .low-stock-action button:hover {
    background-color: #ea580c;
    transform: translateY(-1px);
  }
  
  /* Empty States */
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
  }
  
  .empty-icon {
    width: 80px;
    height: 80px;
    background-color: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
  }
  
  .empty-icon i {
    font-size: 32px;
    color: var(--text-tertiary);
  }
  
  .empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
  }
  
  .empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
  }
  
  /* Medications Screen */
  .category-filter {
    display: flex;
    overflow-x: auto;
    margin-bottom: 20px;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
  }
  
  .category-filter::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
  }
  
  .category-btn {
    background-color: var(--bg-tertiary);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    margin-right: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 500;
    color: var(--text-secondary);
  }
  
  .category-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
  }
  
  .medications-list {
    margin-bottom: 24px;
  }
  
  .medication-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
  }
  
  .medication-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
    border-left-color: var(--primary-color);
  }
  
  .medication-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 16px;
  }
  
  .medication-info {
    flex: 1;
  }
  
  .medication-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
  }
  
  .medication-info p {
    font-size: 14px;
    color: var(--text-secondary);
  }
  
  .medication-stock {
    text-align: right;
    margin-left: 16px;
  }
  
  .medication-stock p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
  }
  
  .medication-stock h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
  }
  
  .stock-low {
    color: var(--warning-color);
  }
  
  /* Modal */
  .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 20;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
  }
  
  .modal.active {
    display: flex !important;
    animation: modal-fade-in 0.3s ease;
  }
  
  @keyframes modal-fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  .modal-content {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: modal-slide-up 0.3s ease;
  }
  
  @keyframes modal-slide-up {
    from {
      transform: translateY(30px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
  }
  
  .close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
  }
  
  .close-modal:hover {
    color: var(--text-primary);
  }
  
  .modal-body {
    padding: 20px;
  }
  
  /* Bottom Navigation */
  .bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 10;
    box-shadow: 0 -2px 10px var(--shadow-color);
  }
  
  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition-speed);
    position: relative;
  }
  
  .nav-item.active {
    opacity: 1;
    color: var(--primary-color);
  }
  
  .nav-item.active::after {
    content: "";
    position: absolute;
    bottom: -12px;
    width: 4px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 50%;
  }
  
  .nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
  }
  
  .nav-item span {
    font-size: 12px;
    font-weight: 500;
  }
  
  /* Toast */
  .toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 30;
    opacity: 0;
    transition: all var(--transition-speed);
    pointer-events: none;
  }
  
  .toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  
  .toast-icon {
    margin-right: 12px;
  }
  
  .toast-message {
    font-size: 14px;
    font-weight: 500;
  }
  
  /* Profile picture upload */
  .profile-picture-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
  }
  
  .profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .profile-picture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
  }
  
  .profile-picture:hover .profile-picture-overlay {
    opacity: 1;
  }
  
  .profile-picture-overlay i {
    color: white;
    font-size: 24px;
  }
  
  .profile-picture-input {
    display: none;
  }
  
  /* Offline indicator */
  .offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--danger-color);
    color: white;
    text-align: center;
    padding: 8px;
    font-weight: 500;
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }
  
  .offline-indicator.active {
    transform: translateY(0);
  }
  
  /* Loading spinner */
  .loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999; /* Ensure it's above everything else */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
  }
  
  .loading-spinner.active {
    display: flex !important;
    animation: fade-in 0.3s ease;
  }
  
  .spinner {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    animation: spin 1s linear infinite;
  }
  
  /* Splash screen */
  .splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
  }
  
  .splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  .splash-logo {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
  }
  
  .splash-logo i {
    font-size: 60px;
    color: var(--primary-color);
  }
  
  .splash-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
  }
  
  .splash-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
  }
  
  /* Install Prompt */
  .install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    border-left: 4px solid var(--accent-color);
    animation: slide-up 0.5s ease forwards;
  }
  
  .install-prompt.active {
    display: block;
  }
  
  @keyframes slide-up {
    0% {
      transform: translate(-50%, 100%);
      opacity: 0;
    }
    100% {
      transform: translate(-50%, 0);
      opacity: 1;
    }
  }
  
  .install-prompt h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
  }
  
  .install-prompt p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
  }
  
  .install-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }
  
  /* Responsive Adjustments */
  @media (max-width: 360px) {
    .medication-stats {
      grid-template-columns: 1fr 1fr;
    }
  
    .stat-card:last-child {
      grid-column: span 2;
    }
  }
  
  /* Animations */
  @keyframes float {
    0% {
      transform: translateY(0px);
    }
    50% {
      transform: translateY(-5px);
    }
    100% {
      transform: translateY(0px);
    }
  }
  
  /* Custom scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 10px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
  }
  
  /* Medication detail modal improvements */
  .med-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .med-color-large {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-right: 16px;
  }
  
  .med-detail-info {
    flex: 1;
  }
  
  .med-detail-item {
    margin-bottom: 8px;
  }
  
  .detail-label {
    font-weight: 600;
    margin-right: 8px;
  }
  
  .med-detail-section {
    margin-bottom: 24px;
  }
  
  .med-detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
  }
  
  .stock-progress {
    margin-bottom: 16px;
  }
  
  .progress-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
  }
  
  .progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
  }
  
  .stock-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
  }
  
  .stock-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
  }
  
  .med-detail-actions {
    display: flex;
    gap: 12px;
  }
  
  /* Take medication modal improvements */
  .take-med-info {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .take-med-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
  }
  
  .take-med-info p {
    color: var(--text-secondary);
  }
  
  .take-instructions {
    font-style: italic;
    margin-top: 8px;
    color: var(--text-tertiary);
  }
  
  .take-med-time {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
  }
  
  .time-circle {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
  }
  
  .time-circle #take-med-time {
    font-size: 24px;
    font-weight: 700;
  }
  
  .time-circle #take-med-period {
    font-size: 14px;
    opacity: 0.8;
  }
  
  .take-med-actions {
    display: flex;
    gap: 12px;
  }
  
  /* Smart reminder section improvements */
  .smart-reminder-section {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 24px;
    box-shadow: var(--card-shadow);
  }
  
  .smart-reminder-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
  }
  
  .smart-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .smart-option {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .smart-option label {
    flex: 1;
    cursor: pointer;
  }
  
  .tooltip {
    position: relative;
    display: inline-block;
  }
  
  .tooltip i {
    color: var(--text-tertiary);
    cursor: pointer;
  }
  
  .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--bg-color);
    color: var(--text-primary);
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 12px;
  }
  
  .tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
  }
  
  /* Toggle switch improvements */
  .toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
  }
  
  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: .4s;
    border-radius: 34px;
  }
  
  .toggle-switch label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
  }
  
  .toggle-switch input:checked + label {
    background: var(--gradient-primary);
  }
  
  .toggle-switch input:checked + label:before {
    transform: translateX(20px);
  }
  
  /* Settings improvements */
  .settings-group {
    margin-bottom: 24px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
  }
  
  .settings-group h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
  }
  
  .setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
  }
  
  .setting-item:last-child {
    border-bottom: none;
  }
  
  .setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .setting-info i {
    color: var(--text-secondary);
    font-size: 18px;
  }
  
  .theme-selector {
    display: flex;
    gap: 8px;
  }
  
  .theme-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
  }
  
  .theme-option.light {
    background-color: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  }
  
  .theme-option.dark {
    background-color: #0f172a;
  }
  
  .theme-option.active {
    border-color: var(--primary-color);
    transform: scale(1.1);
  }
  
  .language-select {
    background-color: var(--bg-tertiary);
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    cursor: pointer;
  }
  
  .toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  