/**
 * ============================================================
 * PROJECTS PAGE - Custom Styles
 * ============================================================
 * 
 * File ini berisi style tambahan untuk halaman Projects
 * yang tidak tercakup oleh Tailwind CSS
 * 
 * @author Arris Ahmad Fadillah
 * @version 1.0.0
 * ============================================================
 */

/* ============================================================
   BASE STYLES
   ============================================================ */

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

/* Text clamping (untuk browser yang support) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   PROJECT CARD STYLES
   ============================================================ */

.project-card {
    /* Card base */
    position: relative;
    display: flex;
    flex-direction: column;
    
    /* Smooth transitions */
    transition: 
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
}

/* Card hover effect enhancement */
.project-card:hover {
    z-index: 10;
}

/* Card focus state for accessibility */
.project-card:focus-within {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* Project tag hover effect */
.project-tag {
    cursor: pointer;
    user-select: none;
}

.project-tag:hover {
    filter: brightness(0.95);
}

.project-tag:active {
    transform: scale(0.95);
}

/* ============================================================
   FILTER STYLES
   ============================================================ */

/* Category filter button base */
.category-filter {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Category filter hover underline effect */
.category-filter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.category-filter:hover::after,
.category-filter.active::after {
    width: 100%;
}

/* Active filter state */
.category-filter.active {
    color: #14b8a6;
    font-weight: 600;
}

/* Dark mode active filter */
.dark .category-filter.active {
    color: #2dd4bf;
}

/* ============================================================
   SEARCH BOX STYLES
   ============================================================ */

/* Search input container */
.search-container {
    position: relative;
}

/* Search input field */
.search-input {
    transition: 
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
}

.search-input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

/* Search icon animation */
.search-icon {
    transition: transform 0.3s ease;
}

.search-input:focus + .search-icon,
.search-input:not(:placeholder-shown) + .search-icon {
    transform: scale(1.1);
    color: #14b8a6;
}

/* ============================================================
   HERO SECTION STYLES
   ============================================================ */

/* Animated gradient background */
.hero-gradient {
    background: 
        linear-gradient(135deg, 
            rgba(20, 184, 166, 0.1) 0%, 
            rgba(59, 130, 246, 0.1) 50%, 
            rgba(139, 92, 246, 0.1) 100%
        );
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles effect (optional) */
.floating-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* ============================================================
   LOADING STATES
   ============================================================ */

/* Custom loading spinner */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(
        90deg,
        #374151 25%,
        #4b5563 50%,
        #374151 75%
    );
    background-size: 200% 100%;
}

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

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Fade in animation */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Scale up animation */
@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.scale-up {
    animation: scaleUp 0.3s ease forwards;
}

/* Pulse animation for status indicators */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

.status-pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    animation: pulse-ring 2s ease-out infinite;
}

/* ============================================================
   RESPONSIVE STYLES
   ============================================================ */

/* Mobile-first responsive adjustments */
@media (max-width: 640px) {
    /* Smaller padding on cards */
    .project-card .p-5 {
        padding: 1rem;
    }
    
    /* Adjust font sizes */
    .project-card h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .project-card p {
        font-size: 0.8125rem;
    }
    
    /* Stack filter buttons */
    .filter-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-filter {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    /* Full-width search on mobile */
    .search-container {
        width: 100%;
    }
    
    /* Adjust tag spacing */
    .project-tag {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
    .project-card h3 {
        font-size: 1.125rem;
    }
}

/* Large screen optimizations */
@media (min-width: 1280px) {
    /* Wider card layout on large screens */
    .projects-grid {
        gap: 2rem;
    }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Focus visible styles */
.project-card a:focus-visible,
.category-filter:focus-visible,
.search-input:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .project-card:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .project-card {
        border-width: 2px;
    }
    
    .category-filter.active {
        border: 2px solid currentColor;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .category-filter,
    .search-container,
    nav,
    footer {
        display: none;
    }
    
    .projects-grid {
        display: block;
    }
    
    .project-card {
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
}

/* ============================================================
   DARK MODE ENHANCEMENTS
   ============================================================ */

/* Darker shadow in dark mode */
.dark .project-card {
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

.dark .project-card:hover {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.4),
        0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* Enhanced border in dark mode */
.dark .project-card {
    border-color: rgba(75, 85, 99, 0.5);
}

/* ============================================================
   CUSTOM SCROLLBAR (Optional)
   ============================================================ */

/* WebKit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.dark * {
    scrollbar-color: #475569 #1e293b;
}
