/* ===================================
   Lili Delivery Driver App - Styles
   =================================== */

:root {
  --primary-color: #7209B7;
  --primary-dark: #5a0791;
  --primary-light: #9b35d4;
  --gold-color: #F5C200;
  --gold-dark: #d4a800;
  --secondary-color: #007bff;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --text-color: #212529;
  --border-color: #dee2e6;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--light-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===================================
   LOGIN PAGE
   =================================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 60%, #3a0060 100%);
  padding: 20px;
}

.login-box {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  padding: 40px 30px;
  max-width: 400px;
  width: 100%;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo img {
  width: 80px;
  height: 80px;
  margin-bottom: 15px;
}

.login-logo h1 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.login-logo .brand-badge {
  display: inline-block;
  background: var(--gold-color);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-logo p {
  color: #6c757d;
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(114, 9, 183, 0.12);
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

.input-icon .form-control {
  padding-left: 45px;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.alert {
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: none;
}

.alert.show {
  display: block;
  animation: slideDown 0.3s ease;
}

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

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ===================================
   LINKS SECUNDARIOS
   =================================== */

.link-secondary {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.link-secondary:hover { text-decoration: underline; }

.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  display: block;
  text-decoration: none;
}
.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
}

/* ===================================
   REGISTER PAGE
   =================================== */

.register-section {
  background: #faf8fd;
  border: 1px solid #e8d5f5;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}

.register-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-hint {
  font-size: 0.82rem;
  color: #6c757d;
  margin-bottom: 12px;
  margin-top: -8px;
}

.required {
  color: var(--danger-color);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Photo upload */
.photo-upload-group {
  display: flex;
  flex-direction: column;
}

.photo-upload-box {
  width: 130px;
  height: 130px;
  border: 2px dashed var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin: 8px auto;
  transition: border-color 0.3s, background 0.3s;
  background: #fdf5ff;
}

.photo-upload-box:hover {
  background: #f3e4fc;
  border-color: var(--primary-dark);
}

.photo-upload-box--rect {
  width: 100%;
  height: 90px;
  border-radius: 10px;
  margin: 8px 0;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--primary-light);
  font-size: 0.78rem;
  text-align: center;
  padding: 10px;
}

.photo-placeholder i {
  font-size: 2rem;
  color: var(--primary-light);
}

.photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: absolute;
  top: 0; left: 0;
}

/* ===================================
   PENDING APPROVAL PAGE
   =================================== */

.pending-box {
  text-align: center;
  padding: 50px 30px;
}

.pending-icon {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--gold-color), var(--gold-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  box-shadow: 0 6px 20px rgba(245, 194, 0, 0.35);
}

.pending-icon i {
  font-size: 2.5rem;
  color: var(--primary-dark);
}

.pending-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.pending-text {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 30px;
}

.pending-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  background: #faf8fd;
  border: 1px solid #e8d5f5;
  border-radius: 12px;
  padding: 18px 20px;
}

.pending-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #adb5bd;
}

.pending-step i { font-size: 1.1rem; }

.pending-step--done {
  color: #198754;
}
.pending-step--done i { color: #198754; }

.pending-step--active {
  color: var(--primary-color);
  font-weight: 600;
}
.pending-step--active i { color: var(--gold-dark); }

/* ===================================
   DASHBOARD LAYOUT
   =================================== */

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: white;
  box-shadow: var(--shadow);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  width: 40px;
  height: 40px;
}

.header-title h2 {
  font-size: 1.2rem;
  color: var(--dark-color);
  margin-bottom: 2px;
}

.header-title p {
  font-size: 0.8rem;
  color: #6c757d;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.available {
  background: #d4edda;
  color: #155724;
}

.status-badge.busy {
  background: #fff3cd;
  color: #856404;
}

.header-menu {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark-color);
  cursor: pointer;
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 20px;
  padding-bottom: 80px; /* Espacio para bottom nav */
}

/* Cards */
.card {
  background: white;
  border-radius: 15px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark-color);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  background: white;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

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

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(40, 167, 69, 0.1); color: var(--primary-color); }
.stat-icon.secondary { background: rgba(0, 123, 255, 0.1); color: var(--secondary-color); }
.stat-icon.warning { background: rgba(255, 193, 7, 0.1); color: var(--warning-color); }
.stat-icon.danger { background: rgba(220, 53, 69, 0.1); color: var(--danger-color); }

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.85rem;
  color: #6c757d;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 100;
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 5px;
  color: #6c757d;
  text-decoration: none;
  transition: color 0.3s;
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 3px;
}

.nav-item span {
  display: block;
  font-size: 0.75rem;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 30px 20px;
  }
  
  .app-main {
    padding: 15px;
  }
}
