/**
 * MotoRent - Custom Styles
 * Bootstrap 5 + Motors Theme (Dark/Red)
 */

/* ========================================
   VARIABLES Y COLORES
   ======================================== */
:root {
    --motors-red: #cc2121;
    --motors-dark: #232628;
    --motors-gray: #eef1f3;
    --motors-text: #888888;
    --motors-black: #151719;

    /* Bootstrap Overrides */
    --bs-btn-color: #f8f9fa;
    --bs-body-color: #f8f9fa;
    --bs-btn-font-family: inherit;
    --bs-btn-font-size: 1rem;
    --bs-btn-font-weight: 400;
    --bs-btn-line-height: 1.5;
    --bs-btn-bg: transparent;
    --bs-btn-border-width: 1px;
    --bs-btn-border-color: transparent;
    --bs-btn-border-radius: 0.375rem;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
    --bs-btn-disabled-opacity: 0.65;
    --bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);
}

/* ========================================
   TIPOGRAFÍA
   ======================================== */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--motors-black);
    color: #ffffff;
}

.fw-black {
    font-weight: 900;
}

/* ========================================
   COLORES DE MARCA
   ======================================== */
.bg-motors-black {
    background-color: var(--motors-black) !important;
}

.bg-motors-dark {
    background-color: var(--motors-dark) !important;
}

.bg-motors-red {
    background-color: var(--motors-red) !important;
}

.text-motors-red {
    color: var(--motors-red) !important;
}

.border-motors-red {
    border-color: var(--motors-red) !important;
}

.btn-motors-red {
    background-color: var(--motors-red);
    border-color: var(--motors-red);
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-motors-red:hover {
    background-color: #a01818;
    border-color: #a01818;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 33, 33, 0.4);
}

.btn-outline-motors-red {
    background-color: transparent;
    border-color: var(--motors-red);
    color: #f8f9fa !important;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-outline-motors-red:hover {
    background-color: var(--motors-red);
    border-color: var(--motors-red);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 33, 33, 0.4);
}

/* Asegurar que todos los botones tengan texto claro */
.btn {
    color: #f8f9fa !important;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-dark,
.btn-light,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-dark,
.btn-outline-light {
    color: #f8f9fa !important;
}

.btn:hover,
.btn:focus,
.btn:active {
    color: #f8f9fa !important;
}

/* Override para texto muted */
.text-muted {
    --bs-text-opacity: 1;
    color: #f8f9fa !important;
}

/* ========================================
   NAVEGACIÓN
   ======================================== */
.navbar-brand {
    letter-spacing: -2px;
}

.nav-link {
    position: relative;
    padding: 1.5rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--motors-red);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--motors-red) !important;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-bg {
    background-image: url('https://images.unsplash.com/photo-1558981403-c5f9899a28bc?auto=format&fit=crop&q=80&w=1920');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.bg-gradient-overlay {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
}

.skew-bar {
    width: 8px;
    height: 100%;
    transform: skewX(-20deg);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ========================================
   SERVICES SECTION
   ======================================== */
.service-bg {
    background-image: url('https://images.unsplash.com/photo-1480044965905-02098d419e96?auto=format&fit=crop&q=80&w=1920');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* ========================================
   BIKE CARDS
   ======================================== */
.bike-card {
    background-color: #1c1e20;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bike-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(204, 33, 33, 0.2);
}

.bike-card img {
    transition: transform 0.5s ease;
}

.bike-card:hover img {
    transform: scale(1.05);
}

.price-tag {
    background-color: var(--motors-red);
    color: white;
    padding: 8px 20px;
    transform: skewX(-15deg);
    display: inline-block;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.price-tag span {
    display: inline-block;
    transform: skewX(15deg);
}

.bike-type-badge {
    background-color: var(--motors-red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 6px 12px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.thumbnail-gallery {
    background-color: #111;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.thumbnail-item {
    height: 48px;
    flex: 1;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.7;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail-item:hover {
    opacity: 1;
    border-color: var(--motors-red);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   SCROLLBAR PERSONALIZADO
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: var(--motors-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a01818;
}

/* ========================================
   ADMIN PANEL
   ======================================== */
.admin-container {
    background-color: white;
    color: #1f2937;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-sidebar {
    background-color: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.admin-sidebar .nav-btn {
    padding: 12px 16px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    text-align: left;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    color: #6b7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sidebar .nav-btn:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.admin-sidebar .nav-btn.active {
    background-color: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
}

.admin-sidebar .nav-btn i {
    width: 20px;
    text-align: center;
}

/* ========================================
   GANTT CHART
   ======================================== */
.gantt-grid {
    display: grid;
    grid-template-columns: 150px repeat(30, 1fr);
    gap: 1px;
    overflow-x: auto;
    background-color: #e5e7eb;
    border: 1px solid #d1d5db;
}

.gantt-header {
    background-color: #1f2937;
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
}

.gantt-cell {
    background-color: white;
    height: 40px;
    border-right: 1px solid #f3f4f6;
    position: relative;
}

.gantt-cell.occupied {
    background-color: #dbeafe;
}

.gantt-cell.active {
    background-color: #dcfce7;
}

/* ========================================
   TABLES
   ======================================== */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-confirmed {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-completed {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .hero-bg {
        min-height: 500px !important;
    }

    .display-3 {
        font-size: 2.5rem;
    }

    .gantt-grid {
        font-size: 10px;
    }

    .admin-sidebar {
        position: static !important;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.sticky-top-custom {
    position: sticky;
    top: 100px;
}

.z-1 {
    z-index: 1;
}

.z-10 {
    z-index: 10;
}

.cursor-pointer {
    cursor: pointer;
}

/* Form Controls Dark Theme */
.form-control:focus,
.form-select:focus {
    border-color: var(--motors-red);
    box-shadow: 0 0 0 0.2rem rgba(204, 33, 33, 0.25);
}

/* Modal Dark Theme */
.modal-content.bg-dark .form-control,
.modal-content.bg-dark .form-select {
    background-color: #1f2937;
    border-color: #374151;
    color: white;
}

.modal-content.bg-dark .form-control:focus,
.modal-content.bg-dark .form-select:focus {
    background-color: #1f2937;
    color: white;
}

/* ========================================
   MODAL FIXES
   ======================================== */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1056 !important;
}

/* Asegurar que el modal esté centrado */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* ========================================
   PAYMENT CALENDAR (Mensual)
   ======================================== */
.payment-calendar {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    font-size: 9px;
    color: #9ca3af;
    text-transform: uppercase;
    padding: 3px 0;
    letter-spacing: 0.5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    min-height: 28px;
    max-width: 40px;
    margin: 0 auto;
}

.calendar-day:hover:not(.empty):not(.other-month) {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

.calendar-day.empty {
    cursor: default;
    opacity: 0;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.other-month {
    color: #d1d5db;
    cursor: default;
}

.calendar-day.other-month:hover {
    transform: none;
    box-shadow: none;
}

/* Estados de pago en el calendario */
.calendar-day.paid {
    background-color: #10b981;
    color: white;
    font-weight: 600;
}

.calendar-day.today {
    background-color: #6b7280;
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 1.5px #6b7280, 0 0 0 3px rgba(107, 114, 128, 0.2);
}

.calendar-day.upcoming {
    background-color: #f59e0b;
    color: white;
    font-weight: 600;
}

.calendar-day.overdue-1 {
    background-color: #ff6b6b;
    color: white;
    font-weight: 600;
}

.calendar-day.overdue-2 {
    background-color: #dc2626;
    color: white;
    font-weight: 600;
}

.calendar-day.overdue-severe {
    background-color: #8b0000;
    color: white;
    font-weight: 700;
}

.calendar-day.no-payment {
    background-color: #f3f4f6;
    color: #9ca3af;
}

.calendar-day.no-payment:hover {
    background-color: #e5e7eb;
}

/* Indicador de múltiples pagos en un día */
.calendar-day.multiple-payments::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2px;
    background-color: currentColor;
    border-radius: 50%;
    opacity: 0.8;
}

/* Detalles del día */
#day-details {
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.day-detail-item {
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid;
    font-size: 13px;
}

.day-detail-item:last-child {
    margin-bottom: 0;
}

.day-detail-item.paid {
    border-left-color: #10b981;
}

.day-detail-item.pending {
    border-left-color: #f59e0b;
}

.day-detail-item.overdue {
    border-left-color: #dc2626;
}

/* ========================================
   PAYMENT TIMELINE (Backup - si se necesita)
   ======================================== */
.payment-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-period {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    border-left: 6px solid;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-period:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Estados de pago - Colores */
.payment-period.paid {
    background-color: #d1fae5;
    border-left-color: #10b981;
}

.payment-period.today {
    background-color: #f3f4f6;
    border-left-color: #6b7280;
}

.payment-period.upcoming {
    background-color: #fef3c7;
    border-left-color: #f59e0b;
}

.payment-period.overdue-1 {
    background-color: #ffe4e6;
    border-left-color: #ff6b6b;
}

.payment-period.overdue-2 {
    background-color: #fee2e2;
    border-left-color: #dc2626;
}

.payment-period.overdue-severe {
    background-color: #fecaca;
    border-left-color: #8b0000;
}

.payment-period-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.payment-period-title {
    font-weight: 700;
    font-size: 16px;
    color: #1f2937;
}

.payment-period-amount {
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
}

.payment-period-details {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: #6b7280;
}

.payment-period-detail {
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-period-detail i {
    width: 16px;
    text-align: center;
}

.payment-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-status-badge.paid {
    background-color: #10b981;
    color: white;
}

.payment-status-badge.partial {
    background-color: #f59e0b;
    color: white;
}

.payment-status-badge.pending {
    background-color: #6b7280;
    color: white;
}

.payment-status-badge.overdue {
    background-color: #dc2626;
    color: white;
}

/* Progress bar para pagos parciales */
.payment-progress {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.payment-progress-bar {
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s ease;
}
/* ========================================
   ADMIN PANEL - ESTILOS ESPECFICOS
   ======================================== */

/* Fondo claro para admin */.bg-light {
    background-color: #f8f9fa !important;
}

/* Textos oscuros para admin en fondos claros */.bg-light h1,
.bg-light h2,
.bg-light h3,
.bg-light h4,
.bg-light h5,
.bg-light h6,
.bg-light p,
.bg-light span:not(.badge):not(.text-white):not(.text-motors-red),
.bg-light label,
.bg-light td,
.bg-light th,
.bg-light .card-title,
.bg-light .card-text {
    color: #212529 !important;
}

/* Asegurar que los ttulos principales sean oscuros */.admin-tab h2,
.admin-tab h3,
.admin-tab h4 {
    color: #212529 !important;
}

/* Cards en admin con texto oscuro */.bg-light .card {
    color: #212529;
}

.bg-light .card-body {
    color: #212529;
}

/* Tablas en admin */.bg-light table {
    color: #212529;
}

/* Inputs y selects en admin */.bg-light input,
.bg-light select,
.bg-light textarea {
    color: #212529 !important;
}

/* Text-muted en admin debe ser gris oscuro */.bg-light .text-muted {
    color: #6c757d !important;
}

