/*
Theme Name: Lawyer Theme
Description: A custom theme for the Lawyer Map website
Author: Your Name
Version: 1.2
*/

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #FFFFFF;
    color: #333333;
    line-height: 1.6;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Top Bar ===== */
#top-bar {
    background-color: #0057B8;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    gap: 25px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#top-bar .top-bar-link,
#top-bar .subscription-button {
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

#top-bar .top-bar-link:hover,
#top-bar .subscription-button:hover {
    color: #FFFFFF;
    transform: translateY(-2px);
}

#top-bar .subscription-button {
    background-color: #00ccff;
    padding: 6px 12px;
    border-radius: 4px;
}

#top-bar .subscription-button:hover {
    background-color: #3366ff;
}

/* Show full-text and hide short-text in desktop view */
#top-bar .top-bar-link .full-text {
    display: inline;
}

#top-bar .top-bar-link .short-text {
    display: none;
}

/* ===== Main Content Layout ===== */
#main-content {
    display: flex;
    flex: 1;
}

/* ===== Sidebar ===== */
#sidebar {
    width: 320px;
    padding: 20px;
    background-color: #F8FAFC;
    height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 60px;
    border-right: 1px solid #E8ECEF;
    transition: all 0.3s ease;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #E8ECEF;
}

.user-section i {
    font-size: 28px;
    color: #0057B8;
}

.user-section .user-info {
    display: flex;
    flex-direction: column;
}

.user-section .username {
    font-weight: 600;
    font-size: 16px;
    color: #2D3748;
}

.user-section .label {
    font-size: 12px;
    color: #718096;
}

.menu-label {
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    margin: 20px 0 12px;
    letter-spacing: 0.5px;
}

/* ===== Search Form ===== */
#lawyer-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#lawyer-search-form input,
#lawyer-search-form select {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

#lawyer-search-form input:focus,
#lawyer-search-form select:focus {
    border-color: #0057B8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.1);
}

#lawyer-search-form button {
    padding: 10px 16px;
    background-color: #0057B8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

#lawyer-search-form button:hover {
    background-color: #004494;
    transform: translateY(-1px);
}

/* ===== Lawyer List ===== */
#lawyer-list {
    list-style: none;
}

#lawyer-list li {
    background: white;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    cursor: pointer;
}

#lawyer-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 87, 184, 0.1);
}

#lawyer-list li.active {
    border-left: 3px solid #0057B8;
    background-color: #F0F7FF;
}

.lawyer-name {
    font-weight: 600;
    color: #0057B8;
    font-size: 15px;
    margin-bottom: 4px;
}

.lawyer-specialty {
    font-size: 13px;
    color: #4A5568;
    margin-bottom: 4px;
}

.lawyer-address {
    font-size: 13px;
    color: #718096;
    line-height: 1.4;
}

/* ===== Map Container ===== */
#map-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

#lawyer-map {
    flex: 1;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* ===== Map Popup ===== */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    min-width: 250px;
    margin: 12px;
}

/* ===== Load More Button ===== */
#load-more {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    background-color: #0057B8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

#load-more:hover {
    background-color: #004494;
    transform: translateY(-1px);
}

#load-more:disabled {
    background-color: #CBD5E0;
    cursor: not-allowed;
    transform: none;
}

/* ===== Footer ===== */
#footer {
    background-color: #2D3748;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    gap: 25px;
}

#footer a {
    color: #CBD5E0;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

#footer a:hover {
    color: #FFFFFF;
}

/* ===== Lawyer Card Interactions ===== */
.lawyer-card {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-left: 3px solid transparent;
}

.lawyer-card:hover {
    background-color: #f5f9ff;
    transform: translateX(3px);
}

.lawyer-card.active {
    background-color: #e1f0ff;
    border-left: 3px solid #0057B8;
    box-shadow: 0 2px 5px rgba(0, 87, 184, 0.1);
}

.leaflet-marker-icon.active {
    z-index: 1000;
    filter: drop-shadow(0 0 8px rgba(0, 87, 184, 0.6));
}

.lawyer-card .lawyer-name {
    font-weight: 600;
    color: #0057B8;
    margin-bottom: 4px;
}

.lawyer-card .lawyer-specialty {
    color: #4a5568;
    font-size: 13px;
    display: block;
    margin-bottom: 3px;
}

.lawyer-card .lawyer-address {
    color: #718096;
    font-size: 12px;
    line-height: 1.4;
}

/* Active marker styling */
.leaflet-marker-icon.active-marker {
    z-index: 1000;
    filter: drop-shadow(0 0 6px rgba(0, 87, 184, 0.7));
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Improved popup styling */
.lawyer-popup {
    padding: 10px;
    min-width: 250px;
}

.lawyer-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.2);
}

.lawyer-popup .leaflet-popup-content {
    margin: 12px;
}

.lawyer-popup .leaflet-popup-tip {
    background: white;
}

/* Prevent tile loading flickering */
.leaflet-container {
    background: #f5f5f5;
}

/* Map Spinner */
.map-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 4px solid rgba(0, 87, 184, 0.2);
    border-top-color: #0057B8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toast-info {
    background: #0057B8;
}

.toast-error {
    background: #d32f2f;
}

/* State Back Control */
.state-back-control {
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
}

.state-back-button {
    padding: 8px 12px;
    background: #0057B8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.state-back-button:hover {
    background: #004494;
}

.state-filter-label {
    margin-top: 5px;
    font-size: 12px;
    color: #333;
}

/* No Results Message */
.no-results {
    display: block;
    text-align: center;
    color: #718096;
    font-size: 14px;
    margin-top: 20px;
}

/* ===== Geolocation Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2D3748;
}

.modal-content p {
    font-size: 14px;
    color: #718096;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

#allow-location {
    background: #0057B8;
    color: white;
}

#allow-location:hover {
    background: #004494;
}

#deny-location {
    background: #E2E8F0;
    color: #2D3748;
}

#deny-location:hover {
    background: #CBD5E0;
}

/* ===== Mobile Layout ===== */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: -320px;
        top: 60px;
        width: 280px;
        height: calc(100vh - 120px);
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }

    #sidebar.active {
        left: 0;
    }

    #mobile-menu-toggle {
        display: flex;
        position: fixed;
        left: 10px;
        top: 10px;
        z-index: 1100;
        background: #0057B8;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 8px;
        font-size: 18px;
        width: 36px;
        height: 36px;
        justify-content: center;
        align-items: center;
    }

    #top-bar {
        position: fixed;
        width: 100%;
        z-index: 1000;
        padding: 10px 50px 10px 50px;
        justify-content: space-between;
        gap: 8px;
        height: 60px;
        align-items: center;
    }

    #top-bar .top-bar-link {
        flex: 1;
        min-width: 0;
        justify-content: center;
        flex-direction: column;
        gap: 2px;
    }

    #top-bar .top-bar-link i {
        font-size: 18px;
        margin: 0;
    }

    #top-bar .top-bar-link .full-text {
        display: none;
    }

    #top-bar .top-bar-link .short-text {
        display: block;
        font-size: 10px;
        color: #D7E4F5;
        text-align: center;
        line-height: 1.2;
    }

    #top-bar .subscription-button {
        background-color: #99ff33;
        padding: 6px 8px;
        min-width: auto;
        font-size: 12px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    #top-bar .subscription-button:hover {
        background-color: #cc0000;
    }

    #top-bar .subscription-button i {
        margin-right: 4px;
        font-size: 14px;
    }

    #top-bar .subscription-button span {
        display: inline;
    }

    #map-container {
        margin-top: 60px;
        height: calc(100vh - 120px);
    }

    .toast-notification {
        width: 90%;
        text-align: center;
        font-size: 12px;
        padding: 8px 15px;
    }

    .state-back-control {
        max-width: 200px;
    }

    .state-back-button {
        font-size: 12px;
        padding: 6px 10px;
    }

    .state-filter-label {
        font-size: 10px;
    }

    #footer {
        padding: 10px 15px;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    #footer a {
        font-size: 12px;
        padding: 5px;
    }

    .modal-content {
        padding: 15px;
        max-width: 300px;
    }

    .modal-content h2 {
        font-size: 18px;
    }

    .modal-content p {
        font-size: 13px;
    }

    .modal-buttons button {
        padding: 8px 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #top-bar {
        padding: 10px 30px 10px 30px;
    }

    #top-bar .top-bar-link i {
        font-size: 16px;
    }

    #top-bar .top-bar-link .short-text {
        font-size: 9px;
    }

    #top-bar .subscription-button {
        padding: 5px 6px;
        font-size: 11px;
    }

    #top-bar .subscription-button i {
        font-size: 12px;
        margin-right: 3px;
    }

    #footer {
        padding: 10px 10px;
        gap: 8px;
    }

    #footer a {
        font-size: 11px;
        padding: 4px;
    }

    .modal-content {
        max-width: 280px;
    }

    .modal-content h2 {
        font-size: 16px;
    }

    .modal-content p {
        font-size: 12px;
    }

    .modal-buttons button {
        padding: 7px 12px;
        font-size: 12px;
    }
}