/* 
 * SurfGuru Custom Styles
 * .NET 8.0 / Bootstrap 5 Compatible
 */

/* ============================================
   Base Styles
   ============================================ */
body {
    padding-top: 20px;
    padding-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Container adjustments for wider content */
.container_body {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
}

.container_navigation {
    max-width: 1300px;
    margin: 0 auto;
}

/* Wide container for special layouts */
.container-wide {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   Form Elements
   ============================================ */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    max-width: 280px;
}

input.form-control {
    max-width: 100%;
}

/* ============================================
   Cards & Wells
   ============================================ */
.card {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Legacy well support (Bootstrap 3 -> 5) */
.well {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* ============================================
   Backgrounds
   ============================================ */
.bg-surfguru {
    background-color: #d9fcfc;
}

/* ============================================
   Charts
   ============================================ */
.chartWithMarkerOverlay {
    position: relative;
    width: 100%;
    z-index: 1;
}

.overlay-marker {
    width: 50px;
    height: 50px;
    position: absolute;
    top: 53px;
    left: 528px;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 20px;
}

/* ============================================
   jQuery UI Autocomplete
   ============================================ */
.ui-autocomplete {
    position: absolute;
    cursor: default;
    z-index: 20000 !important;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ui-menu-item {
    padding: 8px 12px;
    cursor: pointer;
}

.ui-menu-item:hover,
.ui-menu-item.ui-state-focus {
    background-color: #f8f9fa;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: #0d6efd !important;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #0d6efd !important;
}

/* ============================================
   Tables
   ============================================ */
.table {
    background-color: white;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* DataTables integration */
.dataTables_wrapper {
    padding: 10px;
}

.dataTables_filter input {
    max-width: 100%;
    margin-left: 10px;
}

/* ============================================
   Wind Speed Color Coding
   ============================================ */
.wind-light {
    background-color: #d4edda !important;
    color: #155724;
}

.wind-moderate {
    background-color: #fff3cd !important;
    color: #856404;
}

.wind-strong {
    background-color: #f8d7da !important;
    color: #721c24;
}

.wind-storm {
    background-color: #f5c6cb !important;
    color: #721c24;
    font-weight: bold;
}

/* ============================================
   Badges & Labels
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /*width: 40px; Adjust size as needed */
    height: 40px; /* Adjust size as needed */
    border-radius: 12px; /* Fixed rounded corners */
    font-size: 14px; /* Adjust font size as needed */
}

.badge-wind {
    font-size: 0.9rem;
}

/* Badge variant for weather icon display (white background, dark text) */
.badge-icon {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #dee2e6;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Links
   ============================================ */
a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* ============================================
   Map Styles
   ============================================ */
#map {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 10px;
    font-size: 14px;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Tablets and up */
@media screen and (min-width: 768px) {
    .jumbotron {
        margin-top: 10px;
    }

    .body-content {
        padding: 0;
    }

    body {
        padding-top: 20px;
    }
}

/* Mobile devices */
@media screen and (max-width: 767px) {
    body {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .container_body,
    .container_navigation,
    .container-wide {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card {
        border-radius: 4px;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    /* Make tables scrollable on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack form elements */
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        max-width: 100%;
    }

    /* Adjust chart height on mobile */
    .chart-container {
        height: 300px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }

    body {
        background-color: white;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-surfguru {
    color: #0d6efd !important;
}

.border-surfguru {
    border-color: #0d6efd !important;
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.shadow-md {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.rounded-lg {
    border-radius: 8px !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* ============================================
   Accessibility
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* ============================================
   Dark mode support (optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Uncomment if you want dark mode support
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    .card,
    .well {
        background-color: #2d2d2d;
        border-color: #404040;
    }

    .table {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    */
}

/* ============================================
   Search Results Dropdown
   ============================================ */
#searchResults {
    color: #212529; /* Bootstrap's default dark text color */
}

#searchResults .search-item {
    transition: background-color 0.15s ease;
}

#searchResults .search-item:hover,
#searchResults .search-item.active {
    background-color: #f8f9fa;
}
