/* ==========================================================================
   Rating / Penilaian Modal Styles (Adapted for PORPROV Banten 2026)
   Theme: #2e85c8 (Tosca / Blue Porprov), Canvas #F3F4F6, Border #E6E8EC
   ========================================================================== */

.rating-popup-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10001 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 16px;
    box-sizing: border-box;
}

.rating-popup-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.rating-popup-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    z-index: 1 !important;
}

.rating-popup-content {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: auto !important;
    z-index: 2 !important;
    background: #ffffff;
    border-radius: 24px;
    width: 95%;
    max-width: 650px;
    max-height: 88vh;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(10px) !important;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid #E6E8EC;
}

.rating-popup-modal.active .rating-popup-content {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

.rating-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #143e5e 0%, #1d5784 50%, #2e85c8 100%);
    border-radius: 24px 24px 0 0;
    flex-shrink: 0;
}

.rating-popup-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.4;
    flex: 1;
    padding-right: 15px;
    letter-spacing: -0.01em;
}

.rating-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: #ffffff;
}

.rating-popup-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.rating-popup-close i {
    font-size: 1.1rem;
}

.rating-popup-body {
    padding: 28px 28px 0 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#ratingForm {
    padding-bottom: 25px;
}

/* Rating Intro Section */
.rating-intro {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #E6E8EC;
}

.rating-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
}

.emoji-rating-container {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}

.emoji-rating-btn {
    background: transparent;
    border: none;
    width: 62px;
    height: 62px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.emoji-rating-btn:hover {
    transform: scale(1.18) translateY(-2px);
}

.emoji-rating-btn.active {
    transform: scale(1.22) translateY(-4px);
    background: rgba(46, 133, 200, 0.08);
}

.emoji-rating-btn .emoji {
    font-size: 2.5rem;
    line-height: 1;
    filter: grayscale(100%);
    opacity: 0.35;
    transition: all 0.25s ease;
}

.emoji-rating-btn:hover .emoji {
    filter: grayscale(0%);
    opacity: 1;
}

.emoji-rating-btn.active .emoji {
    filter: grayscale(0%);
    opacity: 1;
}

.rating-help-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2e85c8;
    margin: 0;
}

/* Form Groups */
.rating-form-group {
    margin-bottom: 18px;
}

.rating-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.45;
}

.required {
    color: #ef4444;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-flow: row wrap;
    align-items: center;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
    margin: 0;
    transition: all 0.2s ease;
}

.radio-label:hover {
    color: #2e85c8;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    accent-color: #2e85c8;
    transition: transform 0.2s ease;
}

.radio-label:hover input[type="radio"] {
    transform: scale(1.1);
}

.radio-label span {
    line-height: 1.2;
    user-select: none;
}

.rating-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #E6E8EC;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #1e293b;
    resize: vertical;
    transition: all 0.2s ease;
    background: #F8FAFC;
    box-sizing: border-box;
}

.rating-form-group textarea:hover {
    border-color: #cbd5e1;
}

.rating-form-group textarea:focus {
    outline: none;
    border-color: #2e85c8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(46, 133, 200, 0.15);
}

.rating-form-group select,
.rating-form-group input[type="text"],
.rating-form-group input[type="number"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #E6E8EC;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #1e293b;
    transition: all 0.2s ease;
    background: #F8FAFC;
    box-sizing: border-box;
}

.rating-form-group select:hover,
.rating-form-group input:hover {
    border-color: #cbd5e1;
}

.rating-form-group select:focus,
.rating-form-group input:focus {
    outline: none;
    border-color: #2e85c8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(46, 133, 200, 0.15);
}

/* Rating Section */
.rating-section {
    margin: 24px 0;
    padding: 20px;
    background: #F3F4F6;
    border-radius: 16px;
    border: 1px solid #E6E8EC;
}

.rating-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
}

.rating-item {
    margin-bottom: 20px;
}

.rating-item:last-child {
    margin-bottom: 0;
}

.rating-item > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
}

.rating-scale-horizontal {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rating-buttons {
    display: flex;
    gap: 6px;
}

.rating-btn-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-btn-option input[type="radio"] {
    display: none;
}

.rating-btn-option .rating-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    font-size: 1.15rem;
    font-weight: 700;
    color: #334155;
    transition: all 0.2s ease;
}

.rating-btn-option:hover .rating-number {
    border-color: #2e85c8;
    color: #2e85c8;
    background: #f0f9ff;
}

.rating-btn-option input[type="radio"]:checked ~ .rating-number {
    background: #2e85c8;
    border-color: #2e85c8;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(46, 133, 200, 0.3);
}

.rating-status {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

/* Footer Section */
.rating-popup-footer {
    display: flex;
    gap: 12px;
    padding: 18px 28px;
    border-top: 1px solid #E6E8EC;
    background: #F8FAFC;
    border-radius: 0 0 24px 24px;
    flex-shrink: 0;
}

.btn-submit-rating,
.btn-cancel-rating {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit-rating {
    background: #2e85c8;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(46, 133, 200, 0.25);
}

.btn-submit-rating:hover {
    background: #256ea6;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(46, 133, 200, 0.35);
}

.btn-cancel-rating {
    background: #e2e8f0;
    color: #475569;
}

.btn-cancel-rating:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* Responsive */
@media (max-width: 768px) {
    .rating-popup-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 20px;
    }

    .rating-popup-header {
        padding: 16px 20px;
        border-radius: 20px 20px 0 0;
    }

    .rating-popup-header h3 {
        font-size: 1.05rem;
    }

    .rating-popup-body {
        padding: 20px 18px 0 18px;
    }

    .emoji-rating-container {
        gap: 8px;
    }

    .emoji-rating-btn {
        width: 52px;
        height: 52px;
    }

    .emoji-rating-btn .emoji {
        font-size: 2rem;
    }

    .rating-scale-horizontal {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .rating-btn-option .rating-number {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
    }

    .rating-popup-footer {
        flex-direction: column;
        padding: 14px 18px;
        border-radius: 0 0 20px 20px;
    }
}
