/* MountyView Map CSS - Frontend styles for WordPress plugin */

/* ========================================
   Root and Container Styles
   ======================================== */

.mountyview-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #f5f5f5;
}

/* ========================================
   Authentication Form Styles
   ======================================== */

#mountyview-auth-form {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#mountyview-auth-form h3 {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a73e8;
    text-align: center;
}

#mountyview-login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    text-align: left;
}

.form-group input {
    padding: 12px 15px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background-color: #fafafa;
    color: #333;
    transition: border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #1a73e8;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-group input:hover {
    border-color: #b3b3b3;
}

/* Error message styling */
.error-message {
    padding: 12px 15px;
    margin-bottom: 20px;
    background-color: #fce8e6;
    border: 1px solid #f44336;
    border-radius: 4px;
    color: #c5221f;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Submit button */
.btn-submit {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #1a73e8;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    text-align: center;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: #1665d8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.4);
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.4);
}

.btn-submit:disabled {
    background-color: #9aa0a6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Map Container Layout
   ======================================== */

#mountyview-map-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    gap: 0;
}

#mountyview-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========================================
   Filter Panel Styles
   ======================================== */

#mountyview-filters {
    width: 300px;
    padding: 20px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#mountyview-filters h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a73e8;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section h5 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-section label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.filter-section label:last-child {
    margin-bottom: 0;
}

.filter-section label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
}

.filter-section label input[type="checkbox"]:hover {
    opacity: 0.8;
}

.filter-section label input[type="number"] {
    width: 60px;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background-color: #fafafa;
    color: #333;
    transition: border-color 0.3s;
}

.filter-section label input[type="number"]:focus {
    outline: none;
    border-color: #1a73e8;
    background-color: #ffffff;
}

.filter-section label input[type="range"] {
    flex: 1;
    cursor: pointer;
    accent-color: #1a73e8;
}

#mountyview-filters .btn-apply {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: #34a853;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
    margin-top: 15px;
}

#mountyview-filters .btn-apply:hover {
    background-color: #2d8e47;
}

#mountyview-filters .btn-apply:active {
    transform: translateY(1px);
}

/* Monster categories list styling */
#monster-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#monster-categories-list label {
    margin-bottom: 0;
}

/* ========================================
   Map Styles
   ======================================== */

#mountyview-map {
    flex: 1;
    min-height: 400px;
    background-color: #e5e3df;
    position: relative;
    overflow: hidden;
}

/* Leaflet map container customization */
#mountyview-map .leaflet-container {
    font-family: inherit;
    background-color: #e5e3df;
}

/* Leaflet control customization */
#mountyview-map .leaflet-control {
    background-color: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

#mountyview-map .leaflet-control a {
    color: #1a73e8;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
}

#mountyview-map .leaflet-control a:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

/* Marker styles for different entity types */
#mountyview-map .marker-troll {
    background-color: #ea4335;
}

#mountyview-map .marker-monster {
    background-color: #fbbc04;
}

#mountyview-map .marker-treasure {
    background-color: #34a853;
}

#mountyview-map .marker-location {
    background-color: #4285f4;
}

#mountyview-map .marker-mushroom {
    background-color: #a142f4;
}

/* Popup styling */
#mountyview-map .leaflet-popup-content {
    font-size: 12px;
    color: #333;
    max-width: 250px;
}

#mountyview-map .leaflet-popup-content-wrapper {
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#mountyview-map .leaflet-popup-tip {
    background-color: #ffffff;
}

/* Tooltip styling */
#mountyview-map .leaflet-tooltip {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    color: #333;
    font-size: 12px;
    padding: 6px 8px;
}

/* ========================================
   History Timeline/Controls
   ======================================== */

#mountyview-history {
    padding: 15px 20px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#mountyview-history h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#mountyview-history input[type="range"] {
    flex: 1;
    min-width: 150px;
    cursor: pointer;
    height: 6px;
    accent-color: #1a73e8;
}

#mountyview-history input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    background-color: #1a73e8;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#mountyview-history input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: #1a73e8;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#history-date {
    font-size: 13px;
    color: #555;
    min-width: 120px;
    text-align: right;
    white-space: nowrap;
}

.btn-play {
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background-color: #1a73e8;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    white-space: nowrap;
}

.btn-play:hover {
    background-color: #1665d8;
}

.btn-play:active {
    transform: translateY(1px);
}

.btn-play.playing {
    background-color: #ea4335;
}

.btn-play.playing:hover {
    background-color: #d33425;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
    #mountyview-filters {
        width: 250px;
    }

    #mountyview-history {
        flex-direction: column;
        align-items: stretch;
    }

    #history-date {
        text-align: left;
    }
}

@media (max-width: 768px) {
    #mountyview-main-content {
        flex-direction: column;
    }

    #mountyview-filters {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
        overflow-y: auto;
    }

    #mountyview-map {
        min-height: 400px;
    }

    #mountyview-history {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    #mountyview-auth-form {
        margin: 20px;
        padding: 20px;
    }

    #mountyview-auth-form h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    #mountyview-auth-form {
        margin: 15px 10px;
        padding: 15px;
    }

    #mountyview-auth-form h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    #mountyview-filters {
        max-height: 250px;
    }

    #mountyview-filters h4 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .filter-section h5 {
        font-size: 12px;
    }

    .filter-section label {
        font-size: 12px;
    }

    #mountyview-map {
        min-height: 300px;
    }

    #mountyview-history {
        font-size: 12px;
        gap: 8px;
    }

    #history-date {
        min-width: 100px;
    }

    .btn-play {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ========================================
   Accessibility and Print Styles
   ======================================== */

/* Focus visible for keyboard navigation */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #mountyview-filters,
    #mountyview-history {
        display: none;
    }

    #mountyview-map {
        height: auto;
        min-height: 500px;
    }
}

/* ========================================
   Animation Effects
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#mountyview-map-container {
    animation: fadeIn 0.3s ease-in-out;
}

/* ========================================
   Utility Classes
   ======================================== */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}
