/* Basic page and map styling */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

/* Main container for the app */
#container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Map title styling */
#title {
    text-align: center;
    font-size: 20px;
    padding: 10px;
    background-color: #222;
    color: #fff;
}

/* Map container styling */
#map {
    flex-grow: 1; /* Allows map to fill remaining space */
    width: 100%;
}

.leaflet-container {
    font-size: 1rem;
}

/* Custom popup styling */
.foliumpopup table {
    margin: auto;
    width: 100%;
}

.foliumpopup tr {
    text-align: left;
}

.foliumpopup th {
    padding: 4px 8px 4px 4px;
    font-weight: bold;
    vertical-align: top;
}

.foliumpopup td {
    padding: 4px;
}

.leaflet-popup-content {
    margin: 22px 3px 10px 15px;
    min-width: 500px;
}

.issue-info {
    text-align: justify;
    margin: 10px 0 !important;
    font-size: 12px;
}

    .issue-info p {
        color: #4b5563;
    }
        .issue-info span {
        font-weight: bold;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

.popup-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.info-row {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

    .info-row:last-child {
        margin-bottom: 0;
    }

.info-label {
    font-weight: 600;
    color: #374151;
    width: 140px;
    flex-shrink: 0;
}

.info-value {
    color: #4b5563;
    flex: 1;
    line-height: 1.5;
}

.grouped-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.issue-tag {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Solutions Section */
.solutions-section {
    border-top: 2px solid #e5e7eb;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
    .section-title p {
        font-weight: bold;
        font-size: 12px;
    }

.solution-container {
    background: #ffffff;
    margin-bottom: 20px;
    position: relative;
}

.solution-header {
    margin-top: 10px;
}

.solution-title {
    font-weight: bold;
    font-size: 12px;
}

.solution-counter {
    background: #f3f4f6;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.solution-description {
    color: #4b5563;
    line-height: 1.6;
    font-size: 12px;
}

/* Image Gallery */
.image-gallery {
    position: relative;
}

.gallery-header {
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
    font-size: 16px;
}

.image-display {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .image-display img {
        max-width: 100%;
        max-height: 300px;
        object-fit: contain;
        transition: opacity 0.3s ease-in-out;
        opacity: 1;
    }

        .image-display img.fade-out {
            opacity: 0;
        }
.fade-toggle {
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

    .fade-toggle.hidden {
        max-height: 0;
        opacity: 0;
        pointer-events: none;
    }

.hidden {
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 15px;
    height: 40px;
    font-size: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.5;
    color: #fff;
}

    .image-nav:hover {
        background: rgba(0, 0, 0, 0.9);
        opacity: 1;
    }

    .image-nav.prev {
        left: 0;
    }

    .image-nav.next {
        right: 0;
    }

#current-image {
    object-fit: cover !important;
    width: 100%;
    height: auto;
}

#current-image1 {
    object-fit: cover !important;
    width: 100%;
    height: 300px;
}


/* Solution Navigation */
.solution-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
}

.nav-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    font-size: 12px;
}

    .nav-btn:hover {
        background: #2563eb;
        transform: translateY(-1px);
    }

    .nav-btn:disabled {
        background: #9ca3af;
        cursor: not-allowed;
        transform: none;
    }

    .rating-section.show {
        display: block;
        animation: fadeIn 0.3s ease-out;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rating-header {
    text-align: center;
    font-size: 12px;
    margin-bottom: 10px;
}

.rating-title {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
}

.form-group {
    margin-bottom: 10px;
}

.form-label {
    display: block;
    font-size: 12px;
}

.form-input {
    width: 100%;
    padding: 5px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 5px;
    transition: border-color 0.2s ease;
    font-size: 12px;
}

    .form-input:focus {
        outline: none;
        border-color: #3b82f6;
    }

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    font-size: 12px;
}

    .btn-primary:hover {
        background: #2563eb;
        transform: translateY(-1px);
    }

.btn-secondary {
    background: #808080;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    font-size: 12px;
}

    .btn-secondary:hover {
        background: #505050;
        transform: translateY(-1px);
    }

.show-rating-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 7px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    font-size: 12px;
}

    .show-rating-btn:hover {
        background: #2563eb;
        transform: translateY(-1px);
    }

@media (max-width: 768px) {
    .popup-container {
        width: 98%;
        margin: 10px;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }

    .info-label {
        width: auto;
    }

    .solution-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .solution-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .form-actions {
        flex-direction: column;
    }
}

.star-rating {
    display: inline-block;
    font-size: 24px;
    user-select: none;
}

.star {
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}

    .star.selected,
    .star.hovered {
        color: gold;
    }

.question-text {
    font-size: 12px;
    margin-bottom: 0 !important;
}

.edit-info {
    color: #3b82f6;
    cursor: pointer;
    font-size: 16px;
}

.rating-after-title {
    color: #4b5563;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.highlight {
    background: rgba(255, 235, 59, 0.3);
    padding: 2px 4px;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}