/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* ========================================
   CSS Variables for Design System
   ======================================== */
:root {
  /* Colors */
  --primary-color: #0066cc;
  --primary-hover: #0052a3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --dark: #343a40;
  --light: #f8f9fa;
  --white: #ffffff;
  
  /* Tesla-inspired colors */
  --tesla-blue: #3e6ae1;
  --tesla-dark: #181b21;
  --tesla-gray: #393c41;
  --tesla-light-gray: #f4f4f4;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 48px rgba(0,0,0,0.15);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Navbar Height */
  --navbar-height: 60px;
}

/* ========================================
   Global Styles
   ======================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: #212529;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
  /* Account for fixed navbar */
  padding-top: var(--navbar-height);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  color: var(--tesla-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* ========================================
   Enhanced Navbar Styles
   ======================================== */
.navbar {
  min-height: var(--navbar-height);
  background-color: var(--white) !important;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-weight: var(--font-weight-semibold);
  transition: transform var(--transition-fast);
}

.navbar-brand:hover {
  transform: translateY(-1px);
}

.navbar-brand img {
  height: 36px;
  width: auto;
}

.navbar-nav .nav-link {
  color: var(--tesla-gray) !important;
  font-weight: var(--font-weight-medium);
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color) !important;
  background-color: rgba(62, 106, 225, 0.08);
}

.navbar-nav .nav-link.active {
  color: var(--primary-color) !important;
  background-color: rgba(62, 106, 225, 0.1);
}

/* Navbar dropdown improvements */
.navbar .dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  margin-top: 0.5rem;
  animation: fadeInDown 0.2s ease;
}

.navbar .dropdown-item {
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
}

.navbar .dropdown-item:hover {
  background-color: var(--light);
  color: var(--primary-color);
}

/* Mobile navbar toggle */
.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* ========================================
   Container and Layout
   ======================================== */
.container {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

/* Main content spacing */
.container.mt-4 {
  margin-top: var(--spacing-xl) !important;
}

/* Page headers */
.page-header {
  margin-bottom: var(--spacing-xxl);
  text-align: center;
}

.page-header h1 {
  font-size: 2.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--tesla-dark);
  margin-bottom: var(--spacing-lg);
}

.page-header p {
  font-size: 1.25rem;
  color: var(--secondary-color);
  max-width: 700px;
  margin: 0 auto;
}

/* ========================================
   Card Styles
   ======================================== */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background-color: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: var(--spacing-lg);
}

.card-body {
  padding: var(--spacing-lg);
}

/* ========================================
   Button Styles
   ======================================== */
.btn {
  font-weight: var(--font-weight-medium);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: white;
}

.btn-success {
  background-color: var(--success-color);
}

.btn-danger {
  background-color: var(--danger-color);
}

/* ========================================
   Form Styles
   ======================================== */
.form-control, .form-select {
  border: 1px solid #ced4da;
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
  outline: none;
}

.form-label {
  font-weight: var(--font-weight-medium);
  color: var(--tesla-dark);
  margin-bottom: 0.5rem;
}

/* ========================================
   Alert/Flash Messages
   ======================================== */
.alert {
  border: none;
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  animation: slideInDown 0.3s ease;
}

.alert-success {
  background-color: #d1f2d9;
  color: #0f5132;
}

.alert-danger {
  background-color: #f8d7da;
  color: #842029;
}

.alert-info {
  background-color: #cff4fc;
  color: #055160;
}

/* ========================================
   Utility Classes
   ======================================== */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

.text-muted { color: var(--secondary-color) !important; }

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
  :root {
    --navbar-height: 56px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .page-header h1 {
    font-size: 2.25rem;
  }
  
  .container {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
}

/* ========================================
   World/Submit Pages Specific Styles
   ======================================== */
/* Bootstrap Icons adjustments */
.bi {
  vertical-align: -0.125em;
}

/* Enhanced form styling for submit page */
.input-group-text {
  background-color: var(--light);
  border-color: #ced4da;
}

.form-control-lg {
  font-size: 1.125rem;
  padding: 0.75rem 1rem;
}

/* Badge enhancements */
.badge {
  font-weight: var(--font-weight-medium);
  padding: 0.375rem 0.75rem;
}

/* Admin panel specific */
.bg-opacity-10 {
  background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Video preview card */
.ratio-16x9 iframe {
  border-radius: var(--radius-sm);
}

/* ========================================
   Existing Styles (preserved)
   ======================================== */
#devise-card a {
  color: #1976D2;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.5rem;
}
#devise-card a:hover {
  text-decoration: underline;
}

/* Devise pages styling - a modern card layout with Tesla FSD branding */
.mb-0 { margin-bottom: 0; }
body.devise-layout {
  /* light gradient background */
  background: #eef2f3;
  background: linear-gradient(135deg, #eef2f3 0%, #8e9eab 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', sans-serif;
  padding: 1rem;
}
#devise-card {
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}
#devise-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333333;
  font-size: 1.5rem;
  font-weight: 600;
}
.field {
  margin-bottom: 1rem;
}
.field label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #555555;
}
/* form inputs narrower so they don't extend to card edges */
/* form text inputs narrower so they don't extend to card edges */
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 90%;
  margin: 0 auto;
  /* slightly reduced padding with larger font for better readability */
  padding: 0.75rem;
  font-size: 1.125rem;
  line-height: 1.4;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
}
/* checkbox styling inline */
.field input[type="checkbox"] {
  width: auto;
  margin: 0;
  vertical-align: middle;
}
/* label next to checkbox inline */
.field input[type="checkbox"] + label {
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
}
/* Keep checkbox label inline with the checkbox */
.devise-layout .field input[type="checkbox"] + label {
  display: inline-block;
  margin: 0 0 0 0.5rem;
  vertical-align: middle;
}
.actions {
  margin-top: 1.5rem;
}
.actions input[type="submit"] {
  width: 100%;
  background-color: #1976D2;
  border: none;
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
}
.actions input[type="submit"]:hover {
  background-color: #0D47A1;
}

/* Form field focus state */
.devise-layout .field input:focus {
  outline: none;
  border-color: #1976D2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

/* Footer links grouping for Sign up and Forgot Password */
.devise-layout .devise-footer-group {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}
.devise-layout .devise-footer-group .left,
.devise-layout .devise-footer-group .right {
  flex: 1;
}
.devise-layout .devise-footer-group .right {
  text-align: right;
}
.devise-layout .devise-footer-group a {
  color: #1976D2;
  text-decoration: none;
}
.devise-layout .devise-footer-group a:hover {
  text-decoration: underline;
}
/* Fade-in animation for Devise card */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Apply fade-in to the card */
#devise-card {
  animation: fadeIn 0.4s ease both;
}
.alert {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  box-sizing: border-box;
}
.alert ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
.alert-success {
  background-color: #d4edda;
  color: #155724;
}
.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

/* Body margin handled by padding-top in global styles above */

/* Home page specific styles */
body.home-body {
  background-color: var(--tesla-dark);
  background-image: linear-gradient(135deg, #181b21 0%, #2a2d33 100%);
  min-height: 100vh;
}

body.home-body h1 {
  color: #7cbee8;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Vehicle Grid and Cards */
.vehicles-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin-top: 0;
  justify-content: center;
  padding: var(--spacing-lg);
}

.vehicle-card {
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  width: 320px;
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.vehicle-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--tesla-blue) 0%, #7cbee8 100%);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
}

.vehicle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.vehicle-card:hover::before {
  transform: translateX(0);
}

.vehicle-image img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 20px;
  object-fit: cover;
  height: 121px;
  max-height: 200px;
}

.vehicle-details {
  text-align: left;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.vehicle-details h2 {
  color: var(--tesla-dark);
  margin-bottom: var(--spacing-md);
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
}

.vehicle-details p {
  margin: var(--spacing-sm) 0;
  color: var(--secondary-color);
  font-size: 0.95rem;
  line-height: 1.5;
}

.vehicle-details strong {
  color: var(--tesla-dark);
  font-weight: var(--font-weight-semibold);
}

.vehicle-info {
  margin: var(--spacing-md) 0;
  padding: var(--spacing-md);
  background-color: var(--light);
  border-radius: var(--radius-md);
  flex: 1;
  border: 1px solid rgba(0,0,0,0.05);
}

.update-available {
  color: #28a745;
  font-weight: 500;
}

.vehicle-actions {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  width: 100%;
  text-align: center;
}

.release-notes-link {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, var(--tesla-blue) 0%, #5c8ee5 100%);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.release-notes-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.release-notes-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(62, 106, 225, 0.3);
  text-decoration: none;
  color: white;
}

.release-notes-link:hover::before {
  width: 300px;
  height: 300px;
}

/* Battery Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 24px;
  background-color: #e9ecef;
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #28a745 0%, #34ce57 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width var(--transition-slow);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    45deg,
    rgba(255,255,255,0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-bar-stripes 1s linear infinite;
}

.progress-percentage {
  color: white;
  font-weight: var(--font-weight-semibold);
  font-size: 0.75rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

@keyframes progress-bar-stripes {
  from { background-position: 0 0; }
  to { background-position: 1rem 0; }
}

/* Software Update Progress Bars */
.software-update-progress-container {
  width: 100%;
  height: 24px;
  background-color: #6c757d;
  border-radius: 0.25rem;
  overflow: hidden;
  margin: 0.5rem 0;
  position: relative;
}

.software-update-progress {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.software-update-progress.download {
  background-color: #007bff;
}

.software-update-progress.install {
  background-color: #fd7e14;
}

.software-update-percentage {
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  z-index: 1;
  width: 100%;
  text-align: center;
  line-height: 1;
}

div.logo-container {
  text-align: center;
  width: 200px;
  margin : auto;
}

div.logo-container img {
  width: 200px;
}

div.account-info {
  text-align: center;
  color : white;
  margin-top: 20px;
  margin-bottom: 30px;
}

div.who-am-i {
  padding : 10px;

}

/* Vehicle Section Headers */
h2.vehicle-separator-heading {
  margin-left: var(--spacing-lg);
  color: var(--white);
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  margin-bottom: var(--spacing-sm);
}

h3.vehicle-separator-subheading {
  margin-left: var(--spacing-lg);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  font-weight: var(--font-weight-normal);
  margin-bottom: var(--spacing-lg);
}

/* Profile Creation Form Enhancements */
.profile-card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.profile-card .card-header {
  background-color: #ffffff;
  color: #212529;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
  padding: 2rem 1.5rem;
}

.profile-card .card-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #0d6efd; /* darker brand blue */
}

.profile-card .card-header p {
  opacity: 0.9;
}

.profile-card .form-control {
  border-radius: 0.5rem;
}

.profile-card .btn-primary {
  background-image: linear-gradient(135deg, #0069d9 0%, #31a8ff 100%);
  border: none;
  transition: background-position 0.3s ease;
  background-size: 200% 200%;
}

.profile-card .btn-primary:hover {
  background-position: right center;
}

/* Profile pages background */
body.profile-body {
  background-color: var(--light);
  min-height: 100vh;
}

/* ========================================
   Self-Driving Stats Section (Compact)
   ======================================== */
.fsd-stats-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 10px 12px;
  background: linear-gradient(135deg, #1a1d23 0%, #2d3139 100%);
  border-radius: var(--radius-md);
}

/* Circular Progress Ring - Compact */
.circular-progress {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.circular-progress svg {
  transform: rotate(-90deg);
  width: 52px;
  height: 52px;
}

.circular-progress .progress-ring-bg {
  fill: none;
  stroke: #3a3d45;
  stroke-width: 4;
}

.circular-progress .progress-ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 131.9; /* 2 * PI * 21 */
  stroke-dashoffset: 131.9;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-progress .progress-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.circular-progress .progress-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  display: block;
}

/* FSD Miles Stats - Compact inline */
.fsd-miles-stats {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

.fsd-miles-value {
  color: #60a5fa;
  font-weight: 600;
}

.fsd-miles-separator {
  color: rgba(255, 255, 255, 0.5);
}

.fsd-miles-total {
  color: #fff;
  font-weight: 500;
}

.fsd-miles-label {
  color: rgba(255, 255, 255, 0.7);
  margin-left: 4px;
}
