/* ============================================
   CARTOBID - Custom Styles
   ============================================ */

/* ---------- Variables ---------- */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ---------- General ---------- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--light-bg);
}

a {
    text-decoration: none;
}

.btn {
    border-radius: var(--border-radius);
}

/* ---------- Navbar ---------- */
.navbar-brand {
    font-size: 1.5rem;
}

.notification-dropdown {
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-img-top {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    height: 200px;
    object-fit: cover;
}

/* ---------- Vehicle Cards ---------- */
.vehicle-card {
    position: relative;
}

.vehicle-card .badge-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.vehicle-card .price-tag {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.vehicle-card .vehicle-info {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.vehicle-card .vehicle-info i {
    width: 20px;
}

/* ---------- Auction Styles ---------- */
.hotbid-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
}

.countdown-display {
    font-size: 4rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.countdown-display.warning {
    color: var(--warning-color);
    animation: pulse 0.5s infinite;
}

.countdown-display.danger {
    color: var(--danger-color);
    animation: pulse 0.3s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.current-bid {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--success-color);
}

.bid-history {
    max-height: 300px;
    overflow-y: auto;
}

.bid-entry {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bid-entry.winning {
    background: rgba(25, 135, 84, 0.2);
}

.bid-entry .bidder {
    font-weight: bold;
}

.bid-entry .amount {
    color: var(--success-color);
}

.bid-entry .time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Quick Bid Buttons */
.quick-bid-btn {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    margin: 0.25rem;
}

/* ---------- Auction Queue ---------- */
.queue-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.queue-item.current {
    background: var(--primary-color);
    color: white;
}

.queue-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ---------- Steps Progress ---------- */
.steps-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.steps-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step-label {
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-align: center;
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--dark-bg);
    font-weight: 500;
}

/* ---------- Image Upload ---------- */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .image-upload-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.image-upload-box {
    aspect-ratio: 4/3;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.image-upload-box:hover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.image-upload-box.required {
    border-color: var(--warning-color);
}

.image-upload-box.has-image {
    border-style: solid;
    border-color: var(--success-color);
}

.image-upload-box img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-box .upload-icon {
    font-size: 2rem;
    color: #dee2e6;
}

.image-upload-box .upload-label {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-align: center;
    padding: 0 0.5rem;
}

.image-upload-box .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    display: none;
}

.image-upload-box.has-image .remove-btn {
    display: block;
}

/* ---------- Dashboard Stats ---------- */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-card .stat-label {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ---------- Negotiation ---------- */
.negotiation-timeline {
    position: relative;
    padding-left: 30px;
}

.negotiation-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.negotiation-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.negotiation-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    box-shadow: var(--box-shadow);
}

.negotiation-item.seller::before {
    background: var(--info-color);
}

.negotiation-item.dealer::before {
    background: var(--warning-color);
}

.negotiation-item.accepted::before {
    background: var(--success-color);
}

.negotiation-bubble {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--box-shadow);
}

.negotiation-bubble .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.negotiation-bubble .meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* ---------- Vehicle Detail ---------- */
.vehicle-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.vehicle-gallery .main-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.vehicle-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vehicle-gallery .thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.vehicle-gallery .thumbnail {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.vehicle-gallery .thumbnail:hover,
.vehicle-gallery .thumbnail.active {
    opacity: 1;
}

.vehicle-gallery .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Vehicle Specs Table */
.specs-table {
    width: 100%;
}

.specs-table th {
    width: 40%;
    font-weight: 500;
    color: var(--secondary-color);
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.specs-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

/* ---------- Bid Agent ---------- */
.bid-agent-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.bid-agent-card .agent-status {
    font-size: 0.9rem;
    opacity: 0.9;
}

.bid-agent-card .max-bid {
    font-size: 1.5rem;
    font-weight: bold;
}

/* ---------- Invoice/Contract Preview ---------- */
.document-preview {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.document-preview .document-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* ---------- Status Badges ---------- */
.badge-draft { background-color: #6c757d; }
.badge-active { background-color: #0d6efd; }
.badge-in_auction { background-color: #fd7e14; }
.badge-sold { background-color: #198754; }
.badge-negotiating { background-color: #ffc107; color: #000; }
.badge-not_sold { background-color: #dc3545; }
.badge-cancelled { background-color: #6c757d; }

/* ---------- Loading Spinner ---------- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--dark-bg);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 576px) {
    .countdown-display {
        font-size: 2.5rem;
    }
    
    .current-bid {
        font-size: 1.75rem;
    }
    
    .steps-progress {
        flex-wrap: wrap;
    }
    
    .step {
        flex: 0 0 33.333%;
        margin-bottom: 1rem;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    .navbar, footer, .btn, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* =========================================================
   Dealer Vehicle Detail – rechte Spalte immer rechts/sticky
   ========================================================= */

/* Container-Reihe im Template:
   <div class="row dealer-detail-layout"> … */
@media (min-width: 992px) {
    .dealer-detail-layout {
        display: flex;
        align-items: flex-start;
        gap: 1.5rem;
    }

    /* Linke Spalte: Bilder + Daten */
    .dealer-detail-layout > .col-lg-7 {
        flex: 0 0 60%;
        max-width: 60%;
    }

    /* Rechte Spalte: Sidebar mit Titel/Auktion/Biet-Agent
       -> bleibt beim Scrollen immer oben rechts sichtbar */
    .dealer-detail-layout > .col-lg-5 {
        flex: 0 0 40%;
        max-width: 40%;
        position: sticky;
        top: 90px;              /* Abstand unter der blauen Navbar */
        align-self: flex-start;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    /* In der Sidebar KEIN Hover-Translate,
       damit sticky nicht beeinträchtigt wird */
    .dealer-detail-layout > .col-lg-5 .card:hover {
        transform: none;
        box-shadow: var(--box-shadow);
    }
}

/* Mobile: normales untereinander-Layout */
@media (max-width: 991.98px) {
    .dealer-detail-layout {
        display: block;
    }

    .dealer-detail-layout > .col-lg-7,
    .dealer-detail-layout > .col-lg-5 {
        max-width: 100%;
        flex: 0 0 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }
}
/* =========================
   Footer Contrast Fix
   ========================= */
footer.bg-dark,
footer.bg-dark p,
footer.bg-dark li,
footer.bg-dark small {
    color: rgba(255, 255, 255, 0.75);
}

footer.bg-dark a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

footer.bg-dark a:hover,
footer.bg-dark a:focus {
    color: #ffffff;
    text-decoration: underline;
}

/* Wenn Bootstrap "text-muted" bei dir kaputt überschrieben ist */
footer.bg-dark .text-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}
footer.bg-dark a {
  color: rgba(255,255,255,.85) !important;
}
footer.bg-dark a:hover {
  color: #ffffff !important;
  text-decoration: underline;
}
footer.bg-dark .text-muted,
footer.bg-dark small {
  color: rgba(255,255,255,.65) !important;
}
