/* Custom CSS for RSUD Lahat - Pengaduan System */

/* Modern Form Styles */
.form-control-elegant:focus {
    outline: none !important;
    border-color: #0066cc !important;
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1) !important;
    background: white !important;
}

.form-control-elegant.is-invalid {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

/* Rating Number Animation */
.rating-number {
    position: relative;
    display: inline-block;
}

.rating-number::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, rgba(0,102,204,0.1), rgba(255,215,0,0.1));
    border-radius: 20px;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.3;
    }
}

/* Modern Rating Styles */
.rating-input {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.star-label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    user-select: none;
}

.star-label:hover {
    transform: scale(1.2) rotate(-10deg) !important;
    color: #ffd700 !important;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5) !important;
}

.rating-input input:checked ~ .star-label,
.rating-input .star-label:hover,
.rating-input .star-label:hover ~ .star-label {
    color: #ffd700 !important;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4) !important;
}

.rating-input input:checked + .star-label {
    animation: starPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes starPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Rating Text Updates */
.rating-input:has(input[value="5"]:checked) ~ .rating-text::after {
    content: "★★★★★ Sangat Puas! Pelayanan Luar Biasa";
    color: #059669;
    font-weight: 600;
}

.rating-input:has(input[value="4"]:checked) ~ .rating-text::after {
    content: "★★★★☆ Puas dengan Pelayanan";
    color: #0066cc;
    font-weight: 600;
}

.rating-input:has(input[value="3"]:checked) ~ .rating-text::after {
    content: "★★★☆☆ Pelayanan Cukup Baik";
    color: #fbbf24;
    font-weight: 600;
}

.rating-input:has(input[value="2"]:checked) ~ .rating-text::after {
    content: "★★☆☆☆ Pelayanan Perlu Ditingkatkan";
    color: #f97316;
    font-weight: 600;
}

.rating-input:has(input[value="1"]:checked) ~ .rating-text::after {
    content: "★☆☆☆☆ Sangat Tidak Puas";
    color: #ef4444;
    font-weight: 600;
}

/* Modern Card Animations */
.review-card-modern {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.review-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(0,102,204,0.1), transparent);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Hero section animations */
.hero-badge {
    animation: fadeInUp 0.8s ease-out;
}

.hero-section h1 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-section p {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

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

/* Rating bar animation */
.rating-bar:hover {
    transform: translateX(5px);
    background: rgba(0,102,204,0.05) !important;
}

/* Button animations */
.submit-btn:active {
    transform: translateY(1px) !important;
}

.cta-btn:active {
    transform: translateY(1px) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem !important;
    }

    .hero-stats {
        flex-direction: column !important;
        gap: 20px !important;
    }

    .rating-overview-card {
        padding: 30px !important;
    }

    .rating-breakdown-card {
        padding: 25px !important;
        margin-top: 30px;
    }

    .form-card {
        padding: 30px 20px !important;
    }

    .star-label {
        font-size: 2.5rem !important;
        margin: 0 2px !important;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 80px 0 !important;
    }

    .section-badge {
        padding: 8px 15px !important;
        font-size: 12px !important;
    }

    .star-label {
        font-size: 2rem !important;
    }
}

/* Loading states */
.form-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.form-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Elegant Pagination Styles */
.pagination-elegant {
    margin: 40px 0;
}

.pagination-list {
    background: white;
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.page-link-elegant {
    position: relative;
    overflow: hidden;
}

.page-link-elegant::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.page-link-elegant:hover::before {
    left: 100%;
}

.pagination-info {
    animation: fadeIn 0.8s ease-out 0.3s both;
}

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

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-list {
        padding: 10px 15px;
        gap: 6px !important;
    }

    .page-link-elegant {
        width: 38px !important;
        height: 38px !important;
        font-size: 14px !important;
    }

    .pagination-info {
        font-size: 12px !important;
        margin-top: 15px !important;
    }

    .pagination-info span {
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .page-link-elegant {
        width: 35px !important;
        height: 35px !important;
        font-size: 13px !important;
    }

    .pagination-list {
        padding: 8px 12px;
        gap: 4px !important;
    }
}

/* Additional Custom Styles for Better Performance */
.hero-section {
    background-attachment: fixed;
    will-change: transform;
}

.form-section-header {
    position: relative;
}

.form-group-elegant {
    position: relative;
}

.error-message {
    animation: slideInDown 0.3s ease-out;
}

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

.alert-success-custom, .alert-error-custom {
    animation: slideInDown 0.5s ease-out;
}

/* Improved accessibility */
.star-label:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 4px;
}

.form-control-elegant:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Better performance for animations */
.review-card-modern,
.hero-badge,
.rating-number {
    will-change: transform;
}

.review-card-modern:hover {
    will-change: auto;
}

/* Print styles */
@media print {
    .hero-section,
    .pagination-elegant,
    .submit-btn,
    .cta-btn {
        display: none !important;
    }

    .review-card-modern {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Custom SweetAlert2 Styles */
.swal2-popup-custom {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    border-radius: 20px !important;
    padding: 2rem !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.swal2-title-custom {
    color: #1a365d !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
}

.swal2-html-custom {
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.swal2-content-custom {
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.swal2-confirm-custom {
    background: linear-gradient(135deg, #0066cc, #004499) !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 12px 30px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0,102,204,0.3) !important;
}

.swal2-confirm-custom:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,102,204,0.4) !important;
}

.swal2-cancel-custom {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 12px 30px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(239,68,68,0.3) !important;
    margin-right: 15px !important;
}

.swal2-cancel-custom:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(239,68,68,0.4) !important;
}

.swal2-icon.swal2-question {
    border-color: #0066cc !important;
    color: #0066cc !important;
}

.swal2-icon.swal2-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
}

.swal2-icon.swal2-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

.swal2-icon.swal2-info {
    border-color: #0066cc !important;
    color: #0066cc !important;
}

.swal2-timer-progress-bar {
    background: linear-gradient(90deg, #10b981, #059669) !important;
}

/* SweetAlert responsive */
@media (max-width: 768px) {
    .swal2-popup-custom {
        padding: 1.5rem !important;
        margin: 1rem !important;
        width: calc(100% - 2rem) !important;
        max-width: 500px !important;
    }

    .swal2-title-custom {
        font-size: 1.25rem !important;
    }

    .swal2-html-custom {
        font-size: 13px !important;
    }

    .swal2-confirm-custom,
    .swal2-cancel-custom {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .swal2-popup-custom {
        padding: 1rem !important;
    }

    .swal2-title-custom {
        font-size: 1.1rem !important;
    }

    .swal2-confirm-custom,
    .swal2-cancel-custom {
        padding: 8px 16px !important;
        font-size: 12px !important;
    }
}

/* CTA Box and Button Animations */
@keyframes ctaBoxEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ctaButtonBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes formCardPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 25px 80px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 30px 90px rgba(0,102,204,0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 25px 80px rgba(0,0,0,0.1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA Box Hover Effects */
.cta-box {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
        transparent,
        rgba(255,255,255,0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.cta-box:hover::before {
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

/* Enhanced CTA Button Styles */
.cta-btn {
    position: relative;
    overflow: hidden;
}

.cta-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255,255,255,0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.cta-btn:hover::after {
    left: 100%;
}

/* Loading state for CTA button */
.cta-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    cursor: wait;
}

/* Form field focus enhancement */
.form-control-elegant:focus {
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Responsive CTA animations */
@media (max-width: 768px) {
    @keyframes ctaBoxEntrance {
        0% {
            opacity: 0;
            transform: translateY(20px) scale(0.98);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    @keyframes ctaButtonBounce {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-4px);
        }
    }
}
