/* Global button palette overrides from theme (applies across the app) */
.btn-primary{
  --bs-btn-bg: var(--bs-primary) !important;
  --bs-btn-border-color: var(--bs-primary) !important;
  --bs-btn-hover-bg: var(--bs-primary) !important;
  --bs-btn-hover-border-color: var(--bs-primary) !important;
  --bs-btn-active-bg: var(--bs-primary) !important;
  --bs-btn-active-border-color: var(--bs-primary) !important;
}
.btn-outline-primary{
  --bs-btn-color: var(--bs-primary) !important;
  --bs-btn-border-color: var(--bs-primary) !important;
  --bs-btn-hover-color: #fff !important;
  --bs-btn-hover-bg: var(--bs-primary) !important;
  --bs-btn-hover-border-color: var(--bs-primary) !important;
  --bs-btn-active-color: #fff !important;
  --bs-btn-active-bg: var(--bs-primary) !important;
  --bs-btn-active-border-color: var(--bs-primary) !important;
}
.btn-secondary{
  --bs-btn-bg: var(--bs-secondary) !important;
  --bs-btn-border-color: var(--bs-secondary) !important;
  --bs-btn-hover-bg: var(--bs-secondary) !important;
  --bs-btn-hover-border-color: var(--bs-secondary) !important;
  --bs-btn-active-bg: var(--bs-secondary) !important;
  --bs-btn-active-border-color: var(--bs-secondary) !important;
}
.btn-outline-secondary{
  --bs-btn-color: var(--bs-secondary) !important;
  --bs-btn-border-color: var(--bs-secondary) !important;
  --bs-btn-hover-color: #fff !important;
  --bs-btn-hover-bg: var(--bs-secondary) !important;
  --bs-btn-hover-border-color: var(--bs-secondary) !important;
  --bs-btn-active-color: #fff !important;
  --bs-btn-active-bg: var(--bs-secondary) !important;
  --bs-btn-active-border-color: var(--bs-secondary) !important;
}

/* Custom styles for Bike Rental POS */

/* Square image wrappers (1:1 aspect-ratio) for category & product photos */
.img-square {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: inherit;
}
.img-square > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card > .img-square.card-img-top {
    border-top-left-radius: var(--bs-card-inner-border-radius, 0.375rem);
    border-top-right-radius: var(--bs-card-inner-border-radius, 0.375rem);
}
.img-square-thumb {
    width: 56px;
    height: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    display: inline-block;
    background-color: #f5f5f5;
}
.img-square-thumb > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.img-square-sm {
    width: 96px;
    height: 96px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    display: inline-block;
    background-color: #f5f5f5;
}
.img-square-sm > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mini photo editor */
.photo-editor-stage {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}
.photo-editor-stage canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.photo-editor-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.photo-editor-grid .peg-169 { position: absolute; display: none; }
.photo-editor-grid .peg-169 {
    left: 0;
    right: 0;
    top: 21.875%;
    bottom: 21.875%;
    outline: 3px solid #000;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
    background-image:
        linear-gradient(to right, #000 3px, transparent 3px),
        linear-gradient(to bottom, #000 3px, transparent 3px);
    background-size: 33.333% 33.333%;
}
.photo-editor-grid.g-169 .peg-169 { display: block; }
.photo-editor-controls .form-range { width: 100%; }
.photo-editor-pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 120px;
}
.photo-editor-pos-grid button {
    aspect-ratio: 1 / 1;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}
.photo-editor-pos-grid button.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}
.photo-editor-pos-grid button[disabled]{ visibility: hidden; }

:root {
    --brand-primary: #08acae;
    --brand-accent: #fab500;
    --bs-primary: #08acae;
    --bs-primary-rgb: 8, 172, 174;
    --bs-warning: #fab500;
    --bs-warning-rgb: 250, 181, 0;
    --bs-link-color: #08acae;
    --bs-link-hover-color: #07949b;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-pills .nav-link {
    color: #495057;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

.nav-pills .nav-link:hover {
    background-color: #e9ecef;
}

.nav-pills .nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

.content-section {
    min-height: 80vh;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.table {
    background-color: white;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.badge {
    font-size: 0.75rem;
}

/* Counter-stijl statusbadges (gedeeld met Active Rentals) */
.badge-status { display:inline-block; padding:3px 8px; border-radius:6px; font-size:.75rem; font-weight:600; }
.badge-active { background:#dbeafe; color:#1e40af; }
.badge-onderweg { background:#fef3c7; color:#92400e; }
.badge-completed { background:#dcfce7; color:#166534; }

.btn {
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Status indicators */
.status-available {
    background-color: #28a745;
}

.status-rented {
    background-color: #dc3545;
}

.status-maintenance {
    background-color: #fab500;
    color: #212529;
}

.status-active {
    background-color: #fab500;
}

.status-completed {
    background-color: #6c757d;
}

.status-overdue {
    background-color: #dc3545;
}

/* Customer search results */
.list-group-item:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Dashboard cards */
.card.bg-primary, .card.bg-success, .card.bg-info, .card.bg-warning {
    border: none;
}

.card.bg-primary h4, .card.bg-success h4, .card.bg-info h4, .card.bg-warning h4 {
    font-weight: bold;
    font-size: 2rem;
    margin-bottom: 0;
}

/* Form styling */
.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(8, 172, 174, 0.25);
}

.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(8, 172, 174, 0.25);
}

/* Modal styling */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* POS modern chips and panel */
#posCatChips .chip { padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 9999px; background:#fff; cursor:pointer; }
#posCatChips .chip.active { background:#f1f5ff; border-color:#cfe0ff; }
.bill-panel { position: sticky; top: 12px; }

/* POS start overlay (voor /kassa embed) */
#pos {
    position: relative;
}
.pos-start-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}
.pos-start-inner {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 40px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    text-align: center;
}
.pos-start-inner h3 {
    font-weight: 700;
}

/* Sidebar collapse functionality */
#sidebar {
    transition: all 0.3s ease-in-out;
    overflow-x: hidden;
    overflow-y: auto;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
}

#sidebar.sidebar-collapsed {
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    flex: 0 0 0 !important;
}

#contentArea {
    transition: all 0.3s ease-in-out;
}

#contentArea.content-collapsed {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Toggle button styling */
#sidebarToggle {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

#sidebarToggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Embed mode: hide chrome when embedded via iframe */
.embed-mode #navbar,
.embed-mode #sidebar {
    display: none !important;
}
.embed-mode .container-fluid {
    margin-top: 0 !important;
}

/* Animation for page transitions */
.content-section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card.bg-primary h4, .card.bg-success h4, .card.bg-info h4, .card.bg-warning h4 {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
}

/* Print styles */
@media print {
    .navbar, .nav, .btn {
        display: none !important;
    }
    
    .content-section {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.375rem;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1055;
}

/* Custom checkbox/radio styling */
.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

/* Progress bars */
.progress {
    height: 0.5rem;
    background-color: #e9ecef;
}

/* Calendar styling */
#calendarEl {
    background: #fff;
    padding: 8px;
    border-radius: 6px;
    min-height: 700px;
}

/* Planbord (planning board) */
.planboard-container {
    background: #fff;
    min-height: 260px;
}

.planboard-gantt {
    width: 100%;
    overflow-x: auto;
}

.planboard-gantt-header {
    display: grid;
    grid-template-columns: 220px auto;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.planboard-gantt-header-left {
    padding: 0.5rem;
    font-weight: 600;
    border-right: 1px solid #e9ecef;
}

.planboard-gantt-header-right {
    overflow: hidden;
}

.planboard-gantt-header-days {
    display: flex;
}

.planboard-gantt-day {
    flex: 1 0 60px;
    min-width: 60px;
    padding: 0.35rem;
    font-size: 0.75rem;
    text-align: center;
    border-left: 1px solid #e9ecef;
}

.planboard-gantt-body {
    max-height: 520px;
    overflow-y: auto;
}

.planboard-gantt-row {
    display: grid;
    grid-template-columns: 220px auto;
    border-bottom: 1px solid #f1f3f5;
}

.planboard-gantt-row-label {
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
    border-right: 1px solid #e9ecef;
    background-color: #fff;
}

.planboard-gantt-row-label-main {
    font-weight: 600;
}

.planboard-gantt-row-label-sub {
    font-size: 0.75rem;
    color: #6c757d;
}

.planboard-gantt-row-track {
    position: relative;
    height: 32px;
    background-color: #fff;
}

.planboard-gantt-block {
    position: absolute;
    top: 4px;
    height: 24px;
    border-radius: 3px;
    padding: 0 6px;
    font-size: 0.7rem;
    color: #212529;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    background-color: rgba(13, 110, 253, 0.12);
    border-left: 4px solid var(--bs-primary);
}

.planboard-gantt-block-status-active {
    border-left-color: var(--brand-accent);
    background-color: rgba(250, 181, 0, 0.16);
}

.planboard-gantt-block-status-completed {
    border-left-color: #6c757d;
    background-color: rgba(108, 117, 125, 0.16);
}

.planboard-gantt-block-status-overdue {
    border-left-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.16);
}

.planboard-empty-row {
    font-size: 0.75rem;
    color: #adb5bd;
    padding: 0.25rem 0.5rem;
}

.planboard-gantt-category-row {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.planboard-legend-badge {
    display: inline-block;
    width: 14px;
    height: 8px;
    border-radius: 999px;
    margin-right: 4px;
}

.planboard-legend-active {
    background-color: rgba(250, 181, 0, 0.9);
}

.planboard-legend-completed {
    background-color: rgba(108, 117, 125, 0.9);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
