/**
 * Klimopgroep Collecteweek - Stylesheet
 * Huisstijl kleuren:
 * - Primary: #FFBD59 (geel/oranje)
 * - White: #FFFFFF
 * - Light: #F3F3F3
 * - Success: #23A455 (groen)
 * - Info: #4054B2 (blauw)
 */

:root {
    --color-primary: #FFBD59;
    --color-primary-dark: #e5a94f;
    --color-white: #FFFFFF;
    --color-light: #F3F3F3;
    --color-success: #23A455;
    --color-info: #4054B2;
    --color-orange: #fd7e14;
    --color-text: #333333;
    --color-muted: #6c757d;
    
    --zone-available: #23A455;
    --zone-claimed: #FFBD59;
    --zone-completed: #4054B2;
}

/* Custom badge colors */
.bg-orange {
    background-color: #fd7e14 !important;
}

.bg-success-light {
    background-color: #5cb85c !important;
    color: #fff !important;
}

/* Base */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--color-light);
}

/* Navbar */
.navbar-custom {
    background: var(--color-primary) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.75rem 1rem;
}

.navbar-custom .navbar-brand {
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.1rem;
}

.navbar-custom .navbar-brand:hover {
    color: var(--color-text);
}

.navbar-custom .btn-outline-light {
    border-color: rgba(0,0,0,0.2);
    color: var(--color-text);
}

.navbar-custom .btn-outline-light:hover {
    background: rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.2);
    color: var(--color-text);
}

/* Map */
#map {
    height: calc(100vh - 56px);
    width: 100%;
    z-index: 1;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.zone-popup {
    padding: 15px;
    text-align: center;
}

.zone-popup h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: var(--color-text);
}

.zone-popup .status {
    font-weight: 600;
    margin-bottom: 10px;
}

.zone-popup .status.available { color: var(--zone-available); }
.zone-popup .status.claimed { color: var(--zone-claimed); }
.zone-popup .status.completed { color: var(--zone-info); }

.zone-popup .btn {
    width: 100%;
    margin-top: 10px;
}

/* Zone Labels on Map */
.zone-label {
    background: transparent;
    border: none;
}

.zone-label-content {
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
}

.zone-label-content .name {
    font-weight: 600;
    color: var(--color-text);
}

.zone-label-content .group {
    color: var(--color-primary-dark);
    font-size: 11px;
}

.zone-label-content .date {
    color: var(--color-muted);
    font-size: 10px;
}

/* Legend */
.legend-color {
    width: 24px;
    height: 16px;
    border-radius: 4px;
    opacity: 0.7;
}

/* Zone List in Sidebar */
.zone-list {
    max-height: 400px;
    overflow-y: auto;
}

.zone-list-item {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--color-light);
    transition: background 0.2s;
}

.zone-list-item:hover {
    background: #e9e9e9;
}

.zone-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.zone-status-dot.status-available { background: var(--zone-available); }
.zone-status-dot.status-claimed { background: var(--zone-claimed); }
.zone-status-dot.status-completed { background: var(--zone-completed); }

/* Modal Customization */
.bg-primary-custom {
    background: var(--color-primary) !important;
}

.bg-primary-custom .modal-title {
    color: var(--color-text);
}

.bg-primary-custom .btn-close {
    filter: none;
}

/* Info Cards */
.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--color-light);
    border-radius: 8px;
}

.info-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    border-radius: 8px;
    font-size: 1.2rem;
}

/* Buttons */
.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-text);
}

.btn-success {
    background: var(--color-success);
    border-color: var(--color-success);
}

.btn-success:hover,
.btn-success:focus {
    background: #1e8f49;
    border-color: #1e8f49;
}

/* Collecting Mode */
.collecting-overlay {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.collecting-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}


.collecting-pulse {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Notes Panel */
.notes-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.2);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: var(--color-primary);
    color: #333;
    border-radius: 20px 20px 0 0;
}

.notes-info {
    padding: 8px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 0.8rem;
}

.notes-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: 40vh;
}

.notes-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.note-item {
    background: #f0f2f5;
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 10px;
}

.note-item.own-note {
    background: #d4edda;
    border-color: #c3e6cb;
}

.note-item.org-note {
    background: #e7f3ff;
    border-color: #b6d4fe;
    border-left: 3px solid #0d6efd;
}

.note-item .note-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-primary-dark);
}

.note-item .note-time {
    font-size: 0.75rem;
    color: #999;
}

.note-item .note-text {
    margin-top: 5px;
    word-break: break-word;
}

@media (min-width: 768px) {
    .notes-panel {
        left: auto;
        right: 20px;
        bottom: 20px;
        width: 400px;
        max-height: 500px;
        border-radius: 20px;
    }
    
    .notes-header {
        border-radius: 20px 20px 0 0;
    }
}

/* Notes Onboarding Tooltip */
.notes-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
    z-index: 1002;
    animation: tooltipBounce 1s ease-in-out infinite;
}

@keyframes tooltipBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.notes-tooltip-arrow {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid var(--color-primary);
    margin: 0 auto;
}

.notes-tooltip-content {
    background: var(--color-primary);
    color: #333;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 280px;
    text-align: center;
    font-size: 0.9rem;
}

.notes-tooltip-content strong {
    font-size: 1rem;
}

/* User Location Marker */
.user-location-marker {
    position: relative;
}

.user-location-dot {
    width: 16px;
    height: 16px;
    background: var(--color-info);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.user-location-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(64, 84, 178, 0.3);
    border-radius: 50%;
    animation: location-pulse 2s infinite;
}

@keyframes location-pulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Toast - Grotere en duidelijkere meldingen */
.toast {
    border: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    min-width: 320px;
    max-width: 400px;
}

.toast-header {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 16px;
}

.toast-body {
    font-size: 1rem;
    padding: 16px;
    line-height: 1.5;
}

.toast.bg-success {
    background-color: #198754 !important;
}

.toast.bg-success .toast-header {
    background-color: #157347;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.toast.bg-success .toast-body {
    color: white;
}

.toast.bg-warning .toast-header {
    background-color: #e0a800;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.toast.bg-danger {
    background-color: #dc3545 !important;
}

.toast.bg-danger .toast-header {
    background-color: #bb2d3b;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.toast.bg-danger .toast-body {
    color: white;
}

/* Form Styling */
.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(255, 189, 89, 0.25);
}

/* Responsive */
@media (max-width: 576px) {
    .navbar-custom {
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-custom .navbar-brand {
        font-size: 1rem;
    }
    
    #map {
        height: calc(100vh - 52px);
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .offcanvas {
        width: 85% !important;
    }
}

/* Admin Specific Styles */
.admin-header {
    background: #2d3748;
}

.admin-sidebar {
    background: var(--color-light);
    min-height: calc(100vh - 56px);
}

.admin-content {
    padding: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
}

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

.stat-card.primary { border-left: 4px solid var(--color-primary); }
.stat-card.success { border-left: 4px solid var(--color-success); }
.stat-card.info { border-left: 4px solid var(--color-info); }

/* Data Tables */
.table-custom {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table-custom thead {
    background: var(--color-light);
}

.table-custom th {
    font-weight: 600;
    color: var(--color-text);
    border: none;
}

.table-custom td {
    vertical-align: middle;
}

/* Zone Editor */
#zoneEditorMap {
    height: 500px;
    border-radius: 12px;
    border: 2px solid var(--color-light);
}

.drawing-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.drawing-tools .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Drawing Toolbar */
.drawing-toolbar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.drawing-toolbar .alert {
    border-radius: 8px;
}

/* Drawing mode active state */
.drawing-active {
    cursor: crosshair !important;
}

.drawing-active * {
    cursor: crosshair !important;
}

/* Prevent text selection during drawing */
.drawing-active {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Leaflet Draw customization */
.leaflet-draw-toolbar a {
    background-color: var(--color-info) !important;
}

.leaflet-draw-actions a {
    background-color: var(--color-primary) !important;
    color: var(--color-text) !important;
}

/* Zone Tooltip Styling */
.zone-tooltip {
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.25);
    padding: 0;
    font-family: inherit;
}

.zone-tooltip::before {
    display: none;
}

.zone-tooltip-content {
    padding: 10px 14px;
    min-width: 140px;
}

.zone-tooltip-content .zone-name {
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--color-text);
}

.zone-tooltip-content .zone-description {
    font-size: 12px;
    color: var(--color-muted);
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.zone-tooltip-content .zone-group {
    font-size: 12px;
    color: var(--color-primary-dark);
}

.zone-tooltip-content .zone-date {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 2px;
}

.zone-tooltip-content .zone-available {
    font-size: 12px;
    color: var(--color-success);
}

.zone-tooltip-content i {
    margin-right: 4px;
    font-size: 10px;
}

/* Status Badges for Zone Preview */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
}

.status-badge.status-available {
    background: rgba(35, 164, 85, 0.15);
    color: var(--color-success);
}

.status-badge.status-claimed {
    background: rgba(255, 189, 89, 0.2);
    color: #b8860b;
}

.status-badge.status-completed {
    background: rgba(64, 84, 178, 0.15);
    color: var(--color-info);
}

/* Zone Status Icons on Map */
.zone-status-icon {
    position: absolute;
    z-index: 500;
    pointer-events: none;
}

.zone-status-icon i {
    font-size: 18px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.zone-status-icon.status-completed i {
    color: var(--color-info);
}

.zone-status-icon.status-claimed i {
    color: #b8860b;
}

/* Stop Collecting Modal */
.stop-option {
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.stop-option:hover {
    border-color: var(--color-primary);
    background: rgba(255, 189, 89, 0.1);
}

.stop-option.selected {
    border-color: var(--color-primary);
    background: rgba(255, 189, 89, 0.15);
}

.stop-option i {
    font-size: 24px;
    margin-right: 12px;
}

/* Live dot animation */
.live-dot {
    width: 10px;
    height: 10px;
    background: #dc3545;
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Day selection buttons */
.day-select-btn {
    min-width: 80px;
    padding: 8px 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.day-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.day-select-btn.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 84, 178, 0.4);
}

.day-select-btn small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Collection Moments Bar */
.collection-moments-bar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-bottom: 2px solid #ffc107;
    padding: 10px 15px;
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.collection-moments-bar .moments-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    font-size: 0.9rem;
}

.collection-moments-bar .moments-content i {
    margin-right: 8px;
}

/* Admin: Moments Grid Layout */
.moments-grid-container {
    width: 100%;
}

.moments-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 4px;
    padding: 0 10px;
}

.moment-slot {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 80px;
}

.moment-card-compact {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.moment-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.days-row {
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 0 10px;
}

.day-card {
    transition: transform 0.2s;
}

.day-card:hover {
    transform: translateY(-1px);
}

/* Claim rows styling */
.claim-main-row {
    transition: background-color 0.15s;
}

.claim-main-row:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.claim-details-row td {
    border-top: none !important;
}

.claim-expand-btn {
    transition: transform 0.2s;
}

.claim-expand-btn[aria-expanded="true"] .collapse-icon {
    transform: rotate(90deg);
}

.collapse-icon {
    transition: transform 0.2s;
}

/* Moment badges in claims table */
.moment-badge {
    transition: all 0.15s;
}

.moment-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Smaller dropdown menu for moments */
.dropdown-menu-sm {
    font-size: 0.85rem;
    min-width: 180px;
}

.dropdown-menu-sm .dropdown-item {
    padding: 0.35rem 0.75rem;
}

.dropdown-menu-sm .dropdown-header {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

/* Claim date info popover trigger */
.claim-date-info {
    transition: color 0.15s;
}

.claim-date-info:hover {
    color: var(--bs-primary) !important;
}

/* Moment add hover button */
.moment-add-hover {
    transition: opacity 0.2s;
}

.moment-add-slot:hover .moment-add-hover {
    opacity: 1 !important;
}

/* Purple styling for combined moments */
.bg-purple-subtle {
    background-color: rgba(111, 66, 193, 0.15) !important;
}

.border-purple {
    border-color: #6f42c1 !important;
}

/* Live collecteren - pulserend icoon */
.live-pulse-marker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.live-pulse-ring {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.4);
    animation: live-pulse 1.5s ease-out infinite;
}

.live-pulse-dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #dc3545;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.5);
    z-index: 1;
}

@keyframes live-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Zone live icon container */
.zone-live-icon {
    overflow: visible !important;
}
