/**
 * MoviTrack v1.0.0
 * Estilos Modernos - Orange & Dark Theme
 * Cliente: Depag Motors
 * Desarrollado por: Michael Mayorga Vargas © 2026
 */

/* ========== Variables de Color Moderno ========== */
:root {
    --primary-orange: #FF7A3D;
    --primary-dark: #FF5A1F;
    --dark-bg: #2C2C2C;
    --darker-bg: #1E1E1E;
    --light-bg: #F5F6FA;
    --white: #FFFFFF;
    --gray-text: #6C757D;
    --gray-light: #E9ECEF;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 20px rgba(255, 122, 61, 0.25);
    --shadow-dark: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ========== Reset y Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: var(--dark-bg);
    line-height: 1.6;
}

/* ========== Contenedores ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-light);
}

/* ========== Grids de Motos y Repuestos ========== */
.moto-grid,
.repuesto-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 992px) {
    .moto-grid,
    .repuesto-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .moto-grid,
    .repuesto-grid {
        grid-template-columns: 1fr;
    }
}

.moto-card,
.repuesto-card {
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.moto-card:hover,
.repuesto-card:hover {
    border-color: var(--primary-orange);
}

.moto-card-header,
.repuesto-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--light-bg);
    border-bottom: 1px solid var(--gray-light);
}

.moto-card-body,
.repuesto-card-body {
    padding: 20px;
}

.moto-card-remove,
.repuesto-card-remove {
    background: transparent;
    border: 1px solid #DC3545;
    color: #DC3545;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.moto-card-remove:hover,
.repuesto-card-remove:hover {
    background: #DC3545;
    color: white;
}

/* ========== Botones Honda ========== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-orange);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--dark-bg);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--darker-bg);
}

.btn-outline {
    background: transparent;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

.btn-outline:hover {
    background: var(--primary-orange);
    color: var(--white);
}

.btn-gray {
    background: var(--gray-text);
    color: var(--white);
}

.btn-gray:hover {
    background: #5a6268;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Formularios ========== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-bg);
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 61, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========== Header / Navbar ========== */
.navbar {
    background: var(--white);
    color: var(--dark-bg);
    padding: 16px 0;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--gray-light);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-orange);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 24px;
    list-style: none;
}

.navbar-menu a {
   color: var(--dark-bg);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar-menu a:hover {
    color: var(--primary-orange);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-user span {
    color: var(--gray-text);
}

/* ========== Login Page ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--white);
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    color: var(--primary-orange);
    font-size: 32px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-text);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--gray-text);
    font-size: 12px;
}

/* ========== Dashboard Layout ========== */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--white);
    color: var(--dark-bg);
    padding: 24px 0;
    box-shadow: var(--shadow);
    border-right: 1px solid var(--gray-light);
}

.sidebar-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--gray-light);
}

.sidebar-brand h2 {
    color: var(--primary-orange);
    font-size: 24px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-text);
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 8px;
    margin: 0 12px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--primary-orange);
    color: var(--white);
}

.main-content {
    background: var(--light-bg);
    padding: 24px;
}

/* ========== Stats Cards ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-card.orange {
    background: var(--primary-orange);
    color: var(--white);
}

.stat-card.dark {
    background: var(--dark-bg);
    color: var(--white);
}

.stat-card.gray {
    background: var(--white);
    border: 1px solid var(--gray-light);
}

.stat-card.black {
    background: var(--dark-bg);
    color: var(--white);
}

.stat-card h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 12px;
    opacity: 0.9;
}

.stat-card.orange h3,
.stat-card.dark h3,
.stat-card.black h3 {
    color: var(--white);
}

.stat-card.gray h3 {
    color: var(--gray-text);
}

.stat-card .value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 8px;
}

.stat-card .change {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

/* ========== Tables ========== */
.table-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-light);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--light-bg);
    color: var(--dark-bg);
}

thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--gray-text);
}

tbody tr {
    border-bottom: 1px solid var(--gray-light);
    transition: background 0.2s;
}

tbody tr:hover {
    background: var(--light-bg);
}

tbody td {
    padding: 16px;
    font-size: 14px;
}

/* ========== Badges / Estados ========== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-sin-agendar {
    background: var(--gray-light);
    color: var(--gray-text);
}

.badge-agendado {
    background: #E3F2FD;
    color: #1976D2;
}

.badge-en-ruta {
    background: #FFF3E0;
    color: var(--primary-orange);
}

.badge-entregado {
    background: #E8F5E9;
    color: var(--success);
}

/* ========== Animaciones ========== */
@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 122, 61, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(255, 122, 61, 0.4);
    }
}

@keyframes pulse-bright {
    0%, 100% {
        opacity: 1;
        background: #FFF3E0;
    }
    50% {
        opacity: 0.8;
        background: #FFE0B2;
    }
}

/* Aplicar animación a badges en ruta */
.badge-en-ruta {
    animation: pulse-bright 2s ease-in-out infinite;
    font-weight: 700;
    border: 2px solid var(--primary-orange);
}

/* Aplicar animación a filas de tabla con estado en ruta */
tbody tr.en-ruta {
    animation: pulse-glow 2s ease-in-out infinite;
    background: rgba(255, 122, 61, 0.05) !important;
}

tbody tr.en-ruta:hover {
    background: rgba(255, 122, 61, 0.1) !important;
}

/* Aplicar a stat cards en ruta */
.stat-card.en-ruta {
    animation: pulse-glow 2s ease-in-out infinite;
    border: 2px solid var(--primary-orange);
}

/* Aplicar a mobile cards en ruta */
.mobile-card.en-ruta {
    animation: pulse-glow 2s ease-in-out infinite;
    border-left-width: 6px;
}

/* ========== Modal ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-light);
}

.modal-header h2 {
    color: var(--dark-bg);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-text);
}

.modal-close:hover {
    color: var(--primary-orange);
}

/* ========== Mobile Bottom Nav (Transportista) ========== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-top: 1px solid var(--gray-light);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    list-style: none;
}

.mobile-nav-items a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    color: var(--gray-text);
    text-decoration: none;
    font-size: 11px;
    transition: color 0.3s;
}

.mobile-nav-items a:hover,
.mobile-nav-items a.active {
    color: var(--primary-orange);
}

.mobile-nav-items i {
    font-size: 24px;
    margin-bottom: 4px;
}

/* ========== Photo Upload ========== */
.photo-upload-area {
    border: 3px dashed var(--gray-light);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--light-bg);
}

.photo-upload-area:hover {
    border-color: var(--primary-orange);
    background: var(--white);
}

.photo-upload-area.dragover {
    border-color: var(--primary-orange);
    background: rgba(255, 122, 61, 0.1);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-orange);
    transition: width 0.3s;
}

/* ========== Alerts ========== */
.alert {
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ========== Grid Layout ========== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ========== Utilities ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ========== Modern Headers ========== */
.page-header {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--gray-light);
}

.page-header h1 {
    font-size: 28px;
    color: var(--dark-bg);
    font-weight: 700;
    margin: 0;
}

.page-header .subtitle {
    color: var(--gray-text);
    font-size: 14px;
    margin-top: 4px;
}

/* ========== Mobile Header ========== */
.mobile-header {
    background: var(--white);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-light);
}

.mobile-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-bg);
    margin: 0;
}

.mobile-header .user-badge {
    background: var(--primary-orange);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .main-content {
        padding-bottom: 80px;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .navbar-menu {
        display: none;
    }
    
    .login-card {
        padding: 32px 24px;
    }
}

/* ========== Icons (Simple) ========== */
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--gray-text);
    font-size: 12px;
    border-top: 1px solid var(--gray-light);
    margin-top: 48px;
    background: var(--white);
}
