/* ========================================
   JKE POLIMAS - Colorful & Cheerful Theme
   ======================================== */

/* CSS Variables - Vibrant Rainbow Colors */
:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --secondary-light: #f472b6;
    --accent-color: #f59e0b;
    --accent-light: #fbbf24;
    --success-color: #10b981;
    --success-light: #34d399;
    --info-color: #06b6d4;
    --info-light: #22d3ee;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --pink: #ec4899;
    --pink-light: #f472b6;
    --orange: #f97316;
    --orange-light: #fb923c;
    --teal: #14b8a6;
    --teal-light: #2dd4bf;
    --bg-light: #fefefe;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light-gray: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    --border-color: rgba(0, 0, 0, 0.06);
    --rainbow-gradient: linear-gradient(135deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6, #ec4899);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #fdf2f8 0%, #ede9fe 25%, #dbeafe 50%, #f0fdfa 75%, #fef3c7 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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

/* ========================================
   Animated Background - Fun & Colorful
   ======================================== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* Floating Colorful Shapes */
.electric-lines {
    position: absolute;
    width: 100%;
    height: 100%;
}

.electric-lines::before,
.electric-lines::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: floatBubble 20s ease-in-out infinite;
}

.electric-lines::before {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(168, 85, 247, 0.3));
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.electric-lines::after {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(16, 185, 129, 0.3));
    bottom: -5%;
    right: -5%;
    animation-delay: -10s;
}

@keyframes floatBubble {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(50px, -30px) scale(1.1) rotate(5deg); }
    50% { transform: translate(20px, 20px) scale(0.95) rotate(-5deg); }
    75% { transform: translate(-30px, -10px) scale(1.05) rotate(3deg); }
}

/* Circuit Pattern - Colorful Dots */
.circuit-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    background-image: 
        radial-gradient(circle, rgba(236, 72, 153, 0.4) 2px, transparent 2px),
        radial-gradient(circle, rgba(168, 85, 247, 0.4) 2px, transparent 2px),
        radial-gradient(circle, rgba(6, 182, 212, 0.4) 2px, transparent 2px),
        radial-gradient(circle, rgba(16, 185, 129, 0.4) 2px, transparent 2px),
        radial-gradient(circle, rgba(249, 115, 22, 0.4) 2px, transparent 2px);
    background-size: 100px 100px, 120px 120px, 80px 80px, 140px 140px, 90px 90px;
    background-position: 0 0, 30px 60px, 60px 30px, 90px 90px, 120px 15px;
    animation: dotPattern 30s linear infinite;
}

@keyframes dotPattern {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

/* Colorful Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.7;
    animation: particleFloat 18s infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% {
        transform: translateY(-100vh) rotate(720deg) scale(1);
        opacity: 0;
    }
}

/* Electric Canvas */
#electricCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.4;
}

/* ========================================
   Main Container
   ======================================== */
.main-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   Header - Fun & Colorful
   ======================================== */
.header {
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 40px;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 25px;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: conic-gradient(from 0deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6, #ec4899, #f43f5e);
    border-radius: 50%;
    animation: logoSpin 5s linear infinite, logoPulse 2s ease-in-out infinite;
    filter: blur(30px);
    opacity: 0.5;
}

@keyframes logoSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes logoPulse {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) rotate(180deg) scale(1.1); }
}

.logo-icon {
    font-size: 75px;
    background: linear-gradient(135deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    animation: logoBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(236, 72, 153, 0.3));
}

@keyframes logoBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.title {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 15px;
}

.title-main {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6, #ec4899);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    animation: rainbowText 3s linear infinite;
}

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

.title-sub {
    display: block;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-gray);
    letter-spacing: 1px;
    margin-top: 10px;
}

.tagline {
    font-size: 1.1rem;
    background: linear-gradient(90deg, var(--orange), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    margin-top: 12px;
}

.institution {
    font-size: 0.95rem;
    color: var(--text-light-gray);
    margin-top: 8px;
}

/* ========================================
   Search Bar - Colorful
   ======================================== */
.search-container {
    position: relative;
    max-width: 550px;
    margin: 0 auto 50px;
}

.search-input {
    width: 100%;
    padding: 18px 25px 18px 55px;
    font-size: 1.1rem;
    font-family: 'Rajdhani', sans-serif;
    background: var(--card-bg);
    border: 3px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(135deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 50px;
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.search-input::placeholder {
    color: var(--text-light-gray);
}

.search-input:focus {
    box-shadow: var(--card-hover-shadow), 0 0 30px rgba(236, 72, 153, 0.2);
    transform: scale(1.02);
}

.search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-clear {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input:not(:placeholder-shown) + .search-clear {
    opacity: 1;
}

.search-clear:hover {
    transform: translateY(-50%) scale(1.15) rotate(90deg);
}

/* ========================================
   Links Container
   ======================================== */
.links-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 10px 0;
    min-height: 300px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid transparent;
    border-top-color: var(--pink);
    border-right-color: var(--purple);
    border-bottom-color: var(--teal);
    border-left-color: var(--orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ========================================
   Link Cards - Rainbow Colors
   ======================================== */
.link-card {
    position: relative;
    background: var(--card-bg);
    border: none;
    border-radius: 24px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Rainbow border effect */
.link-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6, #ec4899);
    background-size: 300% 300%;
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: rainbowBorder 4s ease infinite;
}

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

.link-card:hover::before {
    opacity: 1;
}

/* Colorful top bar */
.link-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6, #ec4899);
    border-radius: 24px 24px 0 0;
}

.link-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--card-hover-shadow), 0 0 40px rgba(236, 72, 153, 0.15);
}

.link-card:focus {
    outline: 3px solid var(--pink);
    outline-offset: 3px;
}

/* Card Icon - Rainbow Gradient */
.card-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), rgba(168, 85, 247, 0.1), rgba(6, 182, 212, 0.1));
    border-radius: 18px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.4s ease;
}

.link-card:hover .card-icon {
    transform: scale(1.1) rotate(10deg);
    background: linear-gradient(135deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6);
}

.card-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

.link-card:hover .card-icon img {
    filter: brightness(0) invert(1);
}

.card-icon i {
    font-size: 30px;
    background: linear-gradient(135deg, var(--pink), var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.link-card:hover .card-icon i {
    background: linear-gradient(135deg, white, white);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Content */
.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Arrow */
.card-arrow {
    color: var(--pink);
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.link-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Category Badge - Colorful */
.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Click Badge */
.click-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 4px 12px;
    font-size: 0.7rem;
    background: linear-gradient(135deg, var(--teal), var(--success-light));
    color: white;
    border-radius: 15px;
}

/* ========================================
   Category Section
   ======================================== */
.category-section {
    margin-bottom: 50px;
}

.category-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(90deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6) 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title i {
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--pink), var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Footer - Colorful
   ======================================== */
.footer {
    margin-top: 80px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(to top, rgba(255,255,255,0.9), transparent);
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #f43f5e, #f97316, #fbbf24, #10b981, #06b6d4, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-logo i {
    font-size: 1.8rem;
    animation: logoBounce 2s ease-in-out infinite;
}

.footer-content p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.footer-note {
    font-size: 0.85rem;
    color: var(--text-light-gray);
}

.footer-links {
    margin-top: 20px;
}

.admin-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--card-bg);
    border-radius: 30px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(135deg, var(--pink), var(--purple));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.admin-link:hover {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

/* ========================================
   No Results
   ======================================== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-gray);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--pink), var(--purple), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.6;
}

.no-results p {
    font-size: 1.2rem;
}

/* ========================================
   Ripple Effect
   ======================================== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.4), rgba(168, 85, 247, 0.4));
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1200px) {
    .links-container,
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 20px 15px;
    }
    
    .header {
        padding: 30px 15px;
    }
    
    .title-main {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }
    
    .title-sub {
        font-size: 1rem;
    }
    
    .logo-icon {
        font-size: 50px;
    }
    
    .links-container,
    .links-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .link-card {
        padding: 20px;
    }
    
    .card-icon {
        width: 55px;
        height: 55px;
    }
    
    .card-icon i {
        font-size: 24px;
    }
    
    .card-icon img {
        width: 28px;
        height: 28px;
    }
    
    .search-container {
        margin: 0 auto 35px;
    }
}

@media (max-width: 480px) {
    .title-main {
        font-size: 1.8rem;
    }
    
    .title-sub {
        font-size: 0.9rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    .link-card {
        padding: 18px;
        gap: 15px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-description {
        font-size: 0.85rem;
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.link-card:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .link-card {
        border: 2px solid var(--text-dark);
    }
    
    .card-title {
        font-weight: 700;
    }
}
