:root {
  /* Light theme colors */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #475569;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: all 0.3s ease;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Welcome Screen */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color), #3b82f6);
}

.welcome-logo {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.welcome-logo i {
  font-size: 3rem;
  color: white;
}

.welcome-container h1 {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.welcome-container p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.welcome-form {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.welcome-form input {
  padding: 1rem;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.welcome-form input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Navigation */
.navbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  box-shadow: var(--shadow);
          top: 0; /* Sticks to the top of the viewport */
        /* width: 100%; */
        z-index: 1000;  /* Ensures it stays on top of other content */
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-brand i {
  font-size: 1.8rem;
}

.nav-actions {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1rem;
  /* padding: 0.75rem 1.5rem; */
  border: none;
  border-radius: 2rem;
  /* border-radius: 8px; */
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.875rem;
}
.btn {
  padding: 0.75rem 1rem;
  /* padding: 0.75rem 1.5rem; */
  border: none;
  border-radius: 2rem;
  /* border-radius: 8px; */
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.875rem;
}
.startbtn {
  /* padding: 0.75rem 1rem; */
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 2rem;
  /* border-radius: 8px; */
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-outline {
  /* background: transparent; */
  background-color: var(--primary-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Main Content */
.main-content {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  /* border-radius: 12px; */
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  background: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  /* border-radius: 10px; */
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-content h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Search Section */
.search-section {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-bar {
  flex: 1;
  position: relative;
}

.search-bar i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border-color);
  /* border-radius: 8px; */
  border-radius: 1.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  
  /* border-radius: 8px; */
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  min-width: 150px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Logs Section */
.logs-section {
  background: var(--bg-primary);
  /* border-radius: 12px; */
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.logs-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logs-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.logs-actions {
  display: flex;
  gap: 0.5rem;
}

.logs-container {
  max-height: 600px;
  overflow-y: auto;
}

.no-logs {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.no-logs i {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.no-logs h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.maintenance-entry {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  transition: background-color 0.2s ease;
}

.maintenance-entry:hover {
  background: var(--bg-secondary);
}

.maintenance-entry:last-child {
  border-bottom: none;
}

.entry-icon {
  width: 50px;
  height: 50px;
  /* border-radius: 10px; */
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.entry-icon.oil-change { background: #f59e0b; }
.entry-icon.tire-rotation { background: #6b7280; }
.entry-icon.brake-service { background: #dc2626; }
.entry-icon.inspection { background: #059669; }
.entry-icon.repair { background: #7c3aed; }
.entry-icon.other { background: var(--secondary-color); }

.entry-content {
  flex: 1;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.entry-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.entry-date {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.entry-description {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.entry-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.entry-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.entry-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.entry-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-primary);
  /* border-radius: 12px; */
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-content.small {
  max-width: 400px;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  /* border-radius: 6px; */
  border-radius: 1.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.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(37, 99, 235, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Settings */
.settings-section {
  margin-bottom: 2rem;
}

.settings-section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.theme-option {
  cursor: pointer;
}

.theme-option input[type="radio"] {
  display: none;
}

.theme-preview {
  padding: 1rem;
  border: 2px solid var(--border-color);
  /* border-radius: 8px; */
  border-radius: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  background: var(--bg-secondary);
}

.theme-preview i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.theme-preview.light {
  color: #f59e0b;
}

.theme-preview.dark {
  color: #6366f1;
}

.theme-preview.system {
  color: var(--secondary-color);
}

.theme-option input:checked + .theme-preview {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
}

.data-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.confirmation-icon {
  font-size: 3rem;
  color: var(--warning-color);
  margin-bottom: 1rem;
}

.text-center {
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .main-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .search-section {
    flex-direction: column;
    align-items: stretch;
  }

  .logs-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .logs-actions {
    justify-content: center;
  }

  .maintenance-entry {
    flex-direction: column;
    text-align: center;
  }

  .entry-header {
    flex-direction: column;
    text-align: center;
  }

  .entry-meta {
    justify-content: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .theme-options {
    grid-template-columns: 1fr;
  }

  .data-actions {
    flex-direction: column;
  }

  .modal {
    padding: 0.5rem;
  }

  .welcome-container h1 {
    font-size: 2rem;
  }

  .welcome-container p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-content h3 {
    font-size: 1.5rem;
  }

  .maintenance-entry {
    padding: 1rem;
  }

  .modal-header,
  .modal-body {
    padding: 1rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.maintenance-entry {
  animation: fadeIn 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
/* Add to the end of the file */
[dir="rtl"] {
    /* RTL specific styles */
    .search-bar i {
        right: 1rem;
        left: auto;
    }
    
    .search-bar input {
        padding: 0.75rem 2.5rem 0.75rem 1rem;
    }
    
    .modal-footer {
        justify-content: flex-start;
    }
    
    .entry-header {
        flex-direction: row-reverse;
    }
    
    .entry-meta {
        flex-direction: row-reverse;
    }
    
    .entry-actions {
        flex-direction: row-reverse;
    }
    
    .nav-actions {
        flex-direction: row-reverse;
    }
    
    .form-group label {
        text-align: right;
    }
    
    /* Add any other RTL-specific adjustments needed */
}



/* overlay */

#mms-overlay {
    position: fixed;
    bottom: 20px;
    right: -200px; /* Start off-screen */
    /* background-color: rgba(255, 255, 255, 0.9); */
    /* background-color: var(--background); */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 15px 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    transition: all 0.5s ease;
    /* border: 1px solid #e0e0e0; */
    border: 1px solid var(--text-primary);
    animation: slideinside 1s forwards 2s; /* Animation will start after 2 seconds */
  }
  
  @keyframes slideinside {
    to {
      right: 20px;
    }
  }



  /* #mms-overlay {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 8px 15px 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
  }
   */
  #mms-overlay:hover {
    background-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
  }
  
  .mms-logo {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
  }
  
  #mms-overlay a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    font-weight: 500;
  }
  
  #mms-overlay a:hover {
    color: #000;
  }
        /* Add RTL support styles */
        [dir="rtl"] .text-right {
            text-align: left !important;
        }
        [dir="rtl"] .text-left {
            text-align: right !important;
        }
        [dir="rtl"] .entry-header {
            flex-direction: row-reverse;
        }
        [dir="rtl"] .entry-meta {
            flex-direction: row-reverse;
        }
        [dir="rtl"] .entry-actions {
            flex-direction: row-reverse;
        }
        [dir="rtl"] .search-bar i {
            right: auto;
            left: 12px;
        }
        [dir="rtl"] .search-bar input {
            padding-left: 40px;
            padding-right: 12px;
        }
        [dir="rtl"] .modal-footer {
            flex-direction: row-reverse;
        }
        [dir="rtl"] .theme-options,
        [dir="rtl"] .data-actions {
            flex-direction: row-reverse;
        }