/* Vessel Map Container */
.fl-vessel-map-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.fl-map-wrapper {
    order: 1;
}

.fl-content-section {
    order: 2;
    margin-top: 40px;
}

/* Intro Box */
.fl-intro-box {
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 25px;
    background: #f8fafc;
    border-radius: 8px;
    line-height: 1.7;
}

.fl-intro-box h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 25px 0 10px;
}

.fl-intro-box ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.fl-intro-box p {
    margin-bottom: 15px;
}

/* Disclaimer Box */
.fl-disclaimer-box {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 20px;
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
}

.fl-disclaimer-box h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #1e40af;
}

.fl-disclaimer-box p,
.fl-disclaimer-box ul {
    font-size: 14px;
    line-height: 1.6;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.fl-disclaimer-box ul {
    margin-left: 20px;
}

.fl-disclaimer-box a {
    color: #1e40af;
    text-decoration: underline;
}

/* Stats Summary */
.fl-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.fl-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.fl-stat-card.active { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.fl-stat-card.stale { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }
.fl-stat-card.outdated { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); }
.fl-stat-card.unknown { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }

.fl-stat-number {
    font-size: 42px;
    font-weight: bold;
    margin: 10px 0;
}

.fl-stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filters */
.fl-filters {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.fl-filter-group {
    flex: 1;
    min-width: 150px;
    overflow: hidden;
}

.fl-filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.fl-filter-group select,
.fl-filter-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    min-width: 0;
}

/* Clustering Toggle - prevent growing */
.fl-filters .fl-filter-group.fl-filter-clustering {
    flex: 0 0 auto;
    min-width: auto;
}

.fl-btn-group {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.fl-btn-toggle {
    padding: 10px 16px;
    border: none;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.fl-btn-toggle:first-child {
    border-right: 1px solid #e2e8f0;
}

.fl-btn-toggle:hover {
    background: #f1f5f9;
}

.fl-btn-toggle.active {
    background: #10b981;
    color: white;
}

/* Buttons */
.fl-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fl-btn-reset {
    background: #ef4444;
    color: white;
}

.fl-btn-reset:hover {
    background: #dc2626;
}

.fl-btn-export {
    background: #10b981;
    color: white;
}

.fl-btn-export:hover {
    background: #059669;
}

.fl-btn-primary {
    background: #4f46e5;
    color: white;
}

.fl-btn-primary:hover {
    background: #4338ca;
}

/* Map */
#fl-vessel-map {
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Embed Bar */
.fl-embed-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e293b;
    padding: 12px 20px;
    border-radius: 0 0 8px 8px;
    margin-bottom: 30px;
}

.fl-embed-bar-text {
    color: #94a3b8;
    font-size: 14px;
}

.fl-btn-embed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.fl-btn-embed:hover {
    background: #2563eb;
}

.fl-btn-embed svg {
    width: 16px;
    height: 16px;
}

/* Lightbox */
.fl-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.fl-lightbox.active {
    display: flex;
}

.fl-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.fl-lightbox-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: fl-lightbox-in 0.3s ease;
}

@keyframes fl-lightbox-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.fl-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.fl-lightbox-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Embed Setup (inside lightbox) */
.fl-embed-setup {
    padding: 30px;
}

.fl-embed-setup-header {
    margin-bottom: 25px;
}

.fl-embed-setup-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.fl-embed-setup-header p {
    color: #64748b;
    margin: 0;
    font-size: 14px;
}

.fl-embed-setup-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fl-embed-setup-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.fl-embed-setup-field {
    flex: 1;
}

.fl-embed-setup-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.fl-embed-setup-field label .required {
    color: #ef4444;
}

.fl-embed-setup-field input[type="text"],
.fl-embed-setup-field input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.fl-embed-setup-field input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.fl-embed-setup-field small {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.fl-embed-setup-field-checkbox {
    flex: 0;
    padding-top: 28px;
}

.fl-embed-setup-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.fl-embed-setup-field-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.fl-embed-setup-hint {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
}

.fl-embed-setup-actions {
    padding-top: 10px;
}

.fl-embed-setup-result {
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.fl-embed-setup-result h4 {
    font-size: 14px;
    font-weight: 600;
    color: #166534;
    margin: 0 0 10px 0;
}

.fl-embed-setup-result textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    resize: none;
    background: #fff;
}

.fl-embed-setup-result .fl-btn-copy {
    margin-top: 10px;
    background: #22c55e;
    color: white;
}

.fl-embed-setup-result .fl-btn-copy:hover {
    background: #16a34a;
}

.fl-embed-success {
    color: #166534;
    font-size: 13px;
    margin: 10px 0 0 0;
}

/* Embed Contact (inside lightbox) */
.fl-embed-contact {
    padding: 40px 30px;
    text-align: center;
}

.fl-embed-contact h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 15px 0;
}

.fl-embed-contact p {
    color: #64748b;
    font-size: 15px;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.fl-embed-contact ul {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 25px;
    padding-left: 25px;
}

.fl-embed-contact ul li {
    color: #475569;
    font-size: 14px;
    margin-bottom: 8px;
}

.fl-embed-contact .fl-btn-primary {
    padding: 14px 30px;
    font-size: 16px;
}

.fl-embed-contact-note {
    font-size: 13px !important;
    color: #94a3b8 !important;
    margin-top: 20px !important;
}

/* Tabs */
.fl-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.fl-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
}

.fl-tab:hover {
    color: #334155;
}

.fl-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.fl-tab-content {
    display: none;
}

.fl-tab-content.active {
    display: block;
}

.fl-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fl-tab-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* Vessels Table */
.fl-vessels-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fl-vessels-table th {
    background: #f8fafc;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.fl-vessels-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.fl-vessels-table tr:hover {
    background: #f8fafc;
    cursor: pointer;
}

.fl-vessels-table tr.highlighted {
    background: #fef3c7 !important;
}

/* Status Indicators */
.fl-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.fl-status-dot.green { background: #10b981; }
.fl-status-dot.orange { background: #f97316; }
.fl-status-dot.red { background: #ef4444; }
.fl-status-dot.gray { background: #94a3b8; }

/* Links */
.fl-vessel-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.fl-vessel-link:hover {
    text-decoration: underline;
}

/* Leaflet Popup Overrides */
.leaflet-popup-content {
    margin: 15px;
    min-width: 200px;
}

.leaflet-popup-content h3 {
    margin: 0 0 10px 0;
    color: #1e293b;
}

.leaflet-popup-content p {
    margin: 5px 0;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .fl-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fl-filter-group {
        min-width: 100%;
    }
    
    .fl-embed-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .fl-embed-setup-row {
        flex-direction: column;
    }
    
    .fl-embed-setup-field-checkbox {
        padding-top: 0;
    }
    
    .fl-lightbox-content {
        width: 95%;
        margin: 10px;
    }
}
