/* Professional UI Enhancements */

/* ===================================
   1. SCROLL TO TOP BUTTON
   =================================== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* ===================================
   2. LOADING PROGRESS BAR
   =================================== */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    transition: width 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ===================================
   3. LAZY LOADING IMAGES
   =================================== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* Image placeholder while loading */
img[data-src]:not(.loaded) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   4. ENHANCED FOOTER CONTACT FORM
   =================================== */
.contact-form-footer .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.contact-form-footer .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.contact-form-footer .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

.contact-form-footer .btn-light:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* ===================================
   5. SOCIAL LINKS
   =================================== */
.social-links a {
    display: inline-block;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

/* ===================================
   6. SKELETON LOADER (untuk list items)
   =================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
    width: 60%;
}

.skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* ===================================
   7. SMOOTH TRANSITIONS
   =================================== */
a, button, .btn {
    transition: all 0.3s ease;
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* ===================================
   8. FORM VALIDATION STYLES
   =================================== */
.was-validated .form-control:valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
}

/* ===================================
   9. LOADING SPINNER
   =================================== */
.btn .spinner-border {
    vertical-align: middle;
}

/* ===================================
   10. RESPONSIVE IMPROVEMENTS
   =================================== */
@media (max-width: 576px) {
    .skeleton-title {
        width: 80%;
    }
}

/* ===================================
   11. ACCESSIBILITY IMPROVEMENTS
   =================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===================================
   12. PRINT STYLES
   =================================== */
@media print {
    .scroll-to-top,
    .loading-bar,
    .site-header,
    .site-footer {
        display: none !important;
    }
}

/* ===================================
   13. ENHANCED BUTTON LOADING STATES
   =================================== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ===================================
   14. FORM VALIDATION ANIMATIONS
   =================================== */
.form-control.is-invalid,
.form-select.is-invalid {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.form-control.is-valid {
    animation: validPulse 0.5s;
}

@keyframes validPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* ===================================
   15. MICRO INTERACTIONS
   =================================== */
.btn:active {
    transform: scale(0.95);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ff6b35;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Badge pulse animation */
.badge {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================
   16. TOOLTIP ENHANCEMENTS
   =================================== */
[data-bs-toggle="tooltip"] {
    cursor: help;
}

/* ===================================
   17. PROGRESS BAR ANIMATIONS
   =================================== */
.progress-bar {
    animation: progressAnimation 2s ease-in-out;
}

@keyframes progressAnimation {
    0% {
        width: 0;
    }
}

/* ===================================
   18. PULSE EFFECT FOR NOTIFICATIONS
   =================================== */
.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #ff6b35;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ===================================
   19. SMOOTH CARD REVEALS
   =================================== */
.card-reveal {
    opacity: 0;
    transform: translateY(30px);
    animation: cardReveal 0.6s ease forwards;
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for multiple cards */
.card-reveal:nth-child(1) { animation-delay: 0.1s; }
.card-reveal:nth-child(2) { animation-delay: 0.2s; }
.card-reveal:nth-child(3) { animation-delay: 0.3s; }
.card-reveal:nth-child(4) { animation-delay: 0.4s; }
.card-reveal:nth-child(5) { animation-delay: 0.5s; }
.card-reveal:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
   20. ENHANCED FOCUS STATES
   =================================== */
.form-control:focus,
.form-select:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(26, 26, 26, 0.25);
}

/* ===================================
   21. LOADING OVERLAY
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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