/* Marine Traffic Tracker - Additional Styles */

:root {
    --primary-blue: #0066cc;
    --dark-blue: #004499;
    --light-blue: #e8f4f8;
    --border-color: #ddd;
    --text-muted: #666;
    --background-light: #f8f9fa;
}

/* Leaflet map customization */
.leaflet-container {
    background: #e5e5e5;
    font-family: inherit;
}

.leaflet-control-attribution {
    font-size: 11px;
}

/* Vessel marker styling */
.vessel-marker {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: filter 0.2s;
}

.vessel-marker:hover {
    filter: drop-shadow(0 3px 6px rgba(0, 102, 204, 0.4));
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-tip {
    background: white;
}

/* Enhanced map container */
#mapContainer {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

#mapContainer:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Map controls styling */
#mapControls {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 8px;
    display: flex;
    flex-direction: column;
}

#mapControls button {
    font-size: 0.85rem;
    padding: 6px 12px;
    min-width: 120px;
}

/* Statistics card styling */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    font-size: 2rem;
}

/* Stat card variants */
.stat-card.success {
    border-left-color: #28a745;
}

.stat-card.success h3 {
    color: #28a745;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.warning h3 {
    color: #ffc107;
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-card.danger h3 {
    color: #dc3545;
}

/* Search container */
.search-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.search-container:focus-within {
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.search-container input {
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.search-container input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.1);
}

/* Vessel list container */
#vesselListContainer {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#vesselListContainer.vessel-list-visible {
    animation: slideInFromRight 0.3s ease;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(360px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Vessel list styling */
.vessel-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.vessel-item:hover {
    background-color: var(--background-light);
    border-left-color: var(--primary-blue);
    transform: translateX(4px);
}

.vessel-item:last-child {
    border-bottom: none;
}

.vessel-item-name {
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.vessel-item-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.vessel-speed {
    display: inline-block;
    background: var(--light-blue);
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-blue);
}

.vessel-speed.high {
    background: #fff3cd;
    color: #856404;
}

.vessel-speed.very-high {
    background: #f8d7da;
    color: #721c24;
}

/* Modal styling */
.modal-content {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

/* Modal body */
.modal-body {
    padding: 20px;
}

.modal-body h6 {
    color: var(--primary-blue);
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--light-blue);
}

.modal-body h6:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.modal-body strong {
    color: #333;
    font-weight: 600;
}

.modal-body em {
    color: var(--text-muted);
}

/* Marker popup styling */
.marker-popup {
    font-size: 13px;
    min-width: 200px;
}

.marker-popup-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.marker-popup-info {
    margin: 4px 0;
    line-height: 1.5;
}

.marker-popup-info strong {
    color: #333;
    font-weight: 600;
}

.marker-popup-info em {
    color: var(--text-muted);
}

.marker-popup button {
    margin-top: 10px;
    width: 100%;
}

/* Loading spinner */
.spinner-border {
    color: var(--primary-blue);
    border-width: 0.3em;
}

/* Leaflet zoom control customization */
.leaflet-control-zoom {
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.leaflet-control-zoom a {
    background: white;
    color: var(--primary-blue);
    font-weight: bold;
    border-radius: 3px;
    transition: background 0.2s;
}

.leaflet-control-zoom a:hover {
    background: var(--light-blue);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .row {
        margin-left: -8px;
        margin-right: -8px;
    }

    .col-md-3 {
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 12px;
    }

    #vesselListContainer {
        width: 100% !important;
        height: 300px !important;
        top: auto !important;
        bottom: 0 !important;
        border-radius: 8px 8px 0 0 !important;
    }

    #vesselListContainer.vessel-list-hidden {
        right: 0 !important;
        bottom: -320px !important;
    }

    #vesselListContainer.vessel-list-visible {
        bottom: 0 !important;
    }

    #mapContainer {
        height: 400px;
    }
}

@media (max-width: 576px) {
    .stat-card h3 {
        font-size: 1.5rem;
    }

    .stat-card h6 {
        font-size: 0.8rem;
    }

    #mapControls {
        flex-direction: row;
        flex-wrap: wrap;
    }

    #mapControls button {
        flex: 1;
        min-width: unset;
    }

    .search-container input,
    .search-container button {
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    #mapControls,
    .search-container,
    #vesselListContainer {
        display: none;
    }

    #mapContainer {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Animation for connection status */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#connectionStatus {
    animation: pulse 2s infinite;
}

#connectionStatus[style*="green"] {
    animation: none;
}

/* Scrollbar styling for vessel list */
#vesselList {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) var(--background-light);
}

#vesselList::-webkit-scrollbar {
    width: 6px;
}

#vesselList::-webkit-scrollbar-track {
    background: var(--background-light);
}

#vesselList::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 3px;
}

#vesselList::-webkit-scrollbar-thumb:hover {
    background: var(--dark-blue);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.btn-outline-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Navbar enhancements */
.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Footer styling */
.footer {
    background: var(--background-light);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9rem;
}
