/**
 * Koperasi Pintu Raja - Custom Styles
 * Custom CSS untuk override Tailwind dan tambahan styling
 * 
 * @package Koperasi Pintu Raja
 * @category Stylesheet
 * @author iconicweb
 * @version 1.0
 */

/* ============================================
   CUSTOM UTILITIES
   ============================================ */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   OVERFLOW FIX - Critical for Mobile
   ============================================ */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

*:not(.floating-btn) {
    max-width: 100%;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-slide-down {
    animation: slideDown 0.5s ease-out forwards;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.gradient-bg {
    background: linear-gradient(135deg, #1e7e34 0%, #28a745 50%, #87ceeb 100%);
}

.gradient-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
    position: relative;
    z-index: 1;
}

.gradient-brown {
    background: linear-gradient(135deg, #d4a574 0%, #f5e6d3 50%, #faf7f2 100%);
}

/* ============================================
   FLOATING BUTTONS
   ============================================ */
.floating-btn {
    position: fixed;
    bottom: 30px;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(100px);
}

.floating-btn.show {
    opacity: 1;
    transform: translateY(0);
}

.floating-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#whatsappBtn {
    left: 20px;
    background: #25D366;
}

#backToTopBtn {
    right: 20px;
    background: #1e7e34;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(30, 126, 52, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.active {
    max-height: 500px;
}

/* ============================================
   CARD HOVER EFFECT
   ============================================ */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* ============================================
   INTERSECTION OBSERVER
   ============================================ */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RANGE SLIDER CUSTOM STYLE
   ============================================ */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #1e7e34;
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: none;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #1e7e34;
    transform: scale(1.2);
}

/* ============================================
   RESULT BOX ANIMATION
   ============================================ */
.result-box {
    display: none;
    opacity: 0;
}

.result-box.show {
    display: block;
    animation: slideDown 0.5s ease-out forwards;
}

/* ============================================
   ARTICLE CONTENT STYLING
   ============================================ */
.prose {
    color: #374151;
    line-height: 1.75;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose img {
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.prose blockquote {
    border-left: 4px solid #10b981;
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
    margin: 1.5rem 0;
}

.prose a {
    color: #10b981;
    text-decoration: underline;
}

.prose a:hover {
    color: #059669;
}

/* ============================================
   LINE CLAMP UTILITIES
   ============================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .floating-decoration {
        display: none;
    }
    
    .floating-btn {
        bottom: 20px;
    }
    
    #whatsappBtn {
        left: 15px;
    }
    
    #backToTopBtn {
        right: 15px;
    }
}
