/* Custom styles for KPPU WBS */

/* Base responsive settings */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Responsive container */
.container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(230, 126, 34, 0.2);
}

/* Fade in animation */
.fade-in-section {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

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

/* Staggered animation delays */
.fade-in-section:nth-child(1) { animation-delay: 0.1s; }
.fade-in-section:nth-child(2) { animation-delay: 0.2s; }
.fade-in-section:nth-child(3) { animation-delay: 0.3s; }
.fade-in-section:nth-child(4) { animation-delay: 0.4s; }
.fade-in-section:nth-child(5) { animation-delay: 0.5s; }
.fade-in-section:nth-child(6) { animation-delay: 0.6s; }
.fade-in-section:nth-child(7) { animation-delay: 0.7s; }

/* Icon box styling */
.icon-box {
    flex-shrink: 0;
}

/* Section header styling */
.section-header {
    position: relative;
    display: inline-block;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #E67E22, #f39c12);
    border-radius: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth !important;
    scroll-duration: 800ms;
}

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

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

html::-webkit-scrollbar-thumb {
    background: #E67E22;
    border-radius: 5px;
}

html::-webkit-scrollbar-thumb:hover {
    background: #d35400;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent overflow on small screens */
@media (max-width: 640px) {
    .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Reduce padding on mobile */
    .p-4, .p-6, .p-8 {
        padding: 1rem !important;
    }
    
    /* Stack grids on mobile */
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Full width on mobile */
    .w-full {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Adjust text sizes */
    text-sm {
        font-size: 0.875rem !important;
    }
    
    .text-lg, .text-xl, .text-2xl, .text-3xl {
        font-size: 1.25rem !important;
    }
}

/* Tablet responsive */
@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
    
    .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Fix for tables */
table {
    width: 100%;
    min-width: 600px; /* Allow horizontal scroll on small screens */
}

/* Modal responsive */
@media (max-width: 640px) {
    .fixed.inset-4, .fixed.inset-10 {
        inset: 0.5rem !important;
    }
    
    .rounded-2xl, .rounded-lg {
        border-radius: 0.5rem !important;
    }
}

/* Button responsive */
@media (max-width: 480px) {
    button, .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Form inputs responsive */
input, textarea, select {
    max-width: 100%;
    word-wrap: break-word;
}

/* Header responsive */
@media (max-width: 768px) {
    header {
        padding: 0.5rem !important;
    }
    
    header .flex, header .container {
        flex-wrap: wrap;
    }
}

/* Toast notifications */
.toast-notification {
    min-width: 280px;
    max-width: 350px;
    width: auto;
}

@media (max-width: 640px) {
    .toast-notification {
        min-width: auto;
        max-width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
    }
}
