/* Custom CSS for PJKR UNU Cirebon Website */

/* Dropdown Menu Styles */
.dropdown:hover .dropdown-menu,
.dropdown-menu.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.dropdown-menu {
    transition: all 0.3s ease;
    min-width: 220px;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    z-index: 9999 !important;
    position: absolute !important;
}

.dropdown-menu a:hover {
    transform: translateX(0px);
}

.dropdown-toggle {
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-toggle i,
.dropdown.active .dropdown-toggle i {
    transform: rotate(180deg);
}

/* Smart Dropdown Positioning */
.dropdown-menu.dropdown-right {
    left: auto;
    right: 0;
}

.dropdown-menu.dropdown-center {
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
}

.dropdown-menu.dropdown-center.active,
.dropdown:hover .dropdown-menu.dropdown-center {
    transform: translateX(-50%) translateY(0) !important;
}

/* Force dropdown visibility for debugging */
.dropdown-menu.force-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
    z-index: 10000 !important;
    background: white !important;
    border: 2px solid #0a7e39 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

/* Mobile Dropdown Active State */
@media (max-width: 768px) {
    .dropdown:hover .dropdown-menu {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
    }
    
    .dropdown:hover .dropdown-menu.dropdown-center {
        transform: translateX(-50%) translateY(-10px) !important;
    }
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #0a7e39;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #065a28;
}

/* Navigation Transitions */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

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

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

/* Navbar background on scroll */
.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(10, 126, 57, 0.1);
}

/* Hero Section Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-up-delay-1 {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.fade-in-up-delay-2 {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Section Home */
#home {
    background: url('/images/bg-pjkr-dekstop.png')  no-repeat center center;
    background-size: cover;
    background-attachment: scroll;
    position: relative;
    overflow: hidden;
}

#home .overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 95%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button Animations */
.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(10, 126, 57, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(10, 126, 57, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(10, 126, 57, 0);
    }
}

/* Statistics Counter Animation */
.counter {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

/* Section Reveal Animation */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Gradient Backgrounds */
.gradient-unu-primary {
    background: linear-gradient(135deg, #0a7e39 0%, #2f3c73 100%);
}

.gradient-unu-secondary {
    background: linear-gradient(135deg, #d07f2d 0%, #dcc302 100%);
}

.gradient-unu-accent {
    background: linear-gradient(135deg, #c22522 0%, #2f3c73 100%);
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0a7e39;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Form Styles */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.form-input:focus {
    border-color: #0a7e39;
    box-shadow: 0 0 0 3px rgba(10, 126, 57, 0.1);
}

/* Mobile Slide Menu */
.mobile-slide-menu {
    transition: transform 0.3s ease-in-out;
}

.mobile-slide-menu.active {
    transform: translateX(0) !important;
}

.mobile-menu-overlay {
    transition: opacity 0.3s ease-in-out;
}

.mobile-menu-overlay.active {
    display: block !important;
}

/* Mobile Dropdown inside Slide Menu */
.mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f8f9fa;
}

.mobile-dropdown-menu.active {
    max-height: 500px !important;
    overflow: visible !important;
    border-top: 1px solid #e5e5e5;
    display: block !important;
}

.mobile-dropdown-menu a {
    display: block;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.mobile-dropdown-menu a {
    display: block !important;
    padding: 8px 0;
    transition: color 0.2s ease;
    color: #6b7280 !important;
}

.mobile-dropdown-menu a:hover {
    color: #0a7e39 !important;
    background-color: rgba(10, 126, 57, 0.1);
}

/* Force show submenu items */
.mobile-dropdown-menu.active a {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Mobile dropdown toggle - no rotation */
.mobile-dropdown-toggle i {
    transition: none;
}

.mobile-dropdown-toggle.active i {
    /* No rotation animation */
}

/* Mobile Menu Toggle Button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
}

.mobile-menu-btn:focus {
    outline: 2px solid #0a7e39;
    outline-offset: 2px;
}

/* Back to Top Button */
#backToTop {
    transition: all 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* News/Article Cards */
.news-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.news-card .news-image {
    transition: all 0.3s ease;
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

/* Progress Bars */
.progress-bar {
    background-color: #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0a7e39, #d07f2d);
    border-radius: 10px;
    transition: width 0.8s ease;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #0a7e39, #d07f2d);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #0a7e39;
    border: 3px solid white;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {

    #home {
        background: url('/images/bg-pjkr-mobile.png') no-repeat center center;
        background-size: cover;
        background-attachment: scroll;
        position: relative;
        overflow: hidden;
    }

    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
    
    .section-title {
        font-size: 2rem !important;
    }
    
    .card-hover:hover {
        transform: none;
    }
    
    /* Force 2x2 grid for statistics on mobile */
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Adjust statistics text size for mobile */
    .stats-number {
        font-size: 1.5rem !important;
    }
    
    .stats-label {
        font-size: 0.875rem !important;
    }
    
    /* Mobile padding adjustments */
    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-16 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Mobile text adjustments */
    .text-4xl {
        font-size: 1.875rem !important;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    /* Mobile spacing */
    .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    .mb-12 {
        margin-bottom: 1.5rem !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        color: black !important;
        background: white !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .nav-link::after {
        height: 3px;
    }
    
    .btn {
        border: 2px solid;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Loading States */
.skeleton {
    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;
    }
}

/* Focus States for Accessibility */
.focus-visible:focus {
    outline: 2px solid #0a7e39;
    outline-offset: 2px;
}

/* Custom Radio and Checkbox Styles */
.custom-radio,
.custom-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #0a7e39;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}

.custom-checkbox {
    border-radius: 4px;
}

.custom-radio:checked::after,
.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: #0a7e39;
    border-radius: 50%;
}

.custom-checkbox:checked::after {
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
    background-color: transparent;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Image Lazy Loading */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-scroll {
    will-change: scroll-position;
}

/* UNU Brand Colors as CSS Variables */
:root {
    --unu-green: #0a7e39;
    --unu-red: #c22522;
    --unu-blue: #2f3c73;
    --unu-yellow: #dcc302;
    --unu-orange: #d07f2d;
    --unu-white: #ffffff;
    --unu-gray-light: #f8f9fa;
    --unu-gray: #6c757d;
    --unu-gray-dark: #343a40;
}

/* Additional Animation Classes */
.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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