/* ===== ANIMASI ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.1); }
    50% { box-shadow: 0 0 40px rgba(6, 182, 212, 0.2); }
}
@keyframes sessionPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes firePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-slideIn { animation: slideIn 0.5s ease forwards; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulseGlow { animation: pulseGlow 3s ease-in-out infinite; }
.session-expiring { animation: sessionPulse 1s ease-in-out infinite; }
.streak-fire { animation: firePulse 0.8s ease-in-out infinite alternate; }
.success-pulse { animation: successPulse 0.5s ease; }

html { scroll-behavior: smooth; }

/* ===== GLASSMORPHISM ===== */
.glass-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.bg-grid {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #06b6d4; border-radius: 10px; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    background: linear-gradient(90deg, #06b6d4, #8b5cf6, #ec4899);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 350px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.notification-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.notification-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}
.notification-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}
.notification-warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

/* ===== LOADING SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}
.skeleton-text { height: 12px; border-radius: 4px; }
.skeleton-avatar { width: 60px; height: 60px; border-radius: 50%; }

/* ===== LIGHT MODE ===== */
.light-mode { background-color: #f1f5f9 !important; }
.light-mode .glass-card { background: rgba(255,255,255,0.85) !important; border-color: #e2e8f0 !important; }
.light-mode .text-white { color: #0f172a !important; }
.light-mode .text-slate-400 { color: #64748b !important; }
.light-mode .text-slate-300 { color: #334155 !important; }
.light-mode .border-slate-800 { border-color: #e2e8f0 !important; }
.light-mode .bg-slate-900\/50 { background: rgba(241, 245, 249, 0.8) !important; }
.light-mode input, .light-mode textarea, .light-mode select { background: #ffffff !important; color: #0f172a !important; border-color: #cbd5e1 !important; }
.light-mode input::placeholder { color: #94a3b8 !important; }
.light-mode nav { background: rgba(241, 245, 249, 0.95) !important; border-color: #e2e8f0 !important; }
.light-mode .skeleton { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); }
.light-mode .notification { background: rgba(255,255,255,0.95) !important; }
.light-mode #sessionIndicatorWrapper { background: rgba(255,255,255,0.95) !important; }
.light-mode .streak-card { background: rgba(251, 191, 36, 0.08) !important; }

/* ===== STATUS CONNECTION ===== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    transition: all 0.3s ease;
}
.status-dot.online { background: #34d399; box-shadow: 0 0 10px rgba(52, 211, 153, 0.3); }
.status-dot.offline { background: #f87171; box-shadow: 0 0 10px rgba(248, 113, 113, 0.3); }
.status-dot.loading { background: #fbbf24; animation: pulseGlow 1s infinite; }
.status-dot.refreshing { background: #fbbf24; animation: sessionPulse 0.8s ease-in-out infinite; }

/* ===== SESSION INDICATOR ===== */
#sessionIndicatorWrapper {
    animation: fadeInUp 0.5s ease forwards;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}
#sessionIndicatorWrapper:hover {
    border-color: rgba(6, 182, 212, 0.3);
    transform: scale(1.02);
}

/* ===== STREAK ===== */
.streak-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.2);
}
.streak-days {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed rgba(6, 182, 212, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}
.upload-zone:hover {
    border-color: rgba(6, 182, 212, 0.6);
    background: rgba(6, 182, 212, 0.05);
}
.upload-zone.dragover {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
}

/* ===== SEARCH RESULTS ===== */
.search-result-item {
    transition: all 0.3s ease;
}
.search-result-item:hover {
    background: rgba(6, 182, 212, 0.05);
    transform: translateX(5px);
}

/* ===== GALLERY ===== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img {
    transform: scale(1.05);
}
.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-item:hover .overlay {
    opacity: 1;
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 640px) {
    #sessionIndicatorWrapper {
        bottom: 10px;
        right: 10px;
        padding: 10px;
        max-width: calc(100% - 20px);
    }
    #sessionIndicatorWrapper .flex { flex-wrap: wrap; gap: 8px; }
    #sessionTimeDisplay { font-size: 8px !important; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 320px) {
    .ultra-small\:text-xs { font-size: 0.5rem !important; }
    .ultra-small\:text-sm { font-size: 0.6rem !important; }
    .ultra-small\:p-2 { padding: 0.5rem !important; }
    .gallery-grid { grid-template-columns: 1fr; }
}
/* Tambahan untuk tombol edit/delete di galeri */
.gallery-item .overlay .flex.justify-between {
    margin-top: 4px;
}

.gallery-item .overlay button {
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.gallery-item .overlay button:hover {
    transform: scale(1.05);
}

.gallery-item .absolute {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .absolute {
    opacity: 1;
}

.gallery-item .absolute button {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.05);
}

@media screen and (max-width: 640px) {
    .gallery-item .absolute {
        opacity: 1;
    }
    .gallery-item .absolute button {
        width: 8px;
        height: 8px;
        font-size: 6px;
    }
}
/* ===== SWEETALERT CUSTOM ===== */
.swal2-popup.glass-card {
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.swal2-popup .swal2-title {
    color: #f1f5f9 !important;
    font-weight: 700 !important;
}

.swal2-popup .swal2-html-container {
    color: #94a3b8 !important;
}

.swal2-popup .swal2-input {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
    color: #f1f5f9 !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
}

.swal2-popup .swal2-input:focus {
    border-color: #06b6d4 !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2) !important;
}

.swal2-popup .swal2-validation-message {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
}

.swal2-popup .swal2-timer-progress-bar {
    background: linear-gradient(90deg, #06b6d4, #8b5cf6) !important;
}

/* Light mode untuk SweetAlert */
.light-mode .swal2-popup.glass-card {
    background: rgba(255, 255, 255, 0.95) !important;
}

.light-mode .swal2-popup .swal2-title {
    color: #0f172a !important;
}

.light-mode .swal2-popup .swal2-html-container {
    color: #334155 !important;
}

.light-mode .swal2-popup .swal2-input {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* ===== LIVE CLOCK WIDGET ===== */
.live-clock-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(6, 182, 212, 0.2);
    overflow: hidden;
}
.live-clock-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(6, 182, 212, 0.03), transparent, rgba(139, 92, 246, 0.03), transparent);
    animation: rotateGlow 10s linear infinite;
}
@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.live-clock-time {
    font-size: 2.5rem;
    font-weight: 900;
    font-family: 'Courier New', 'Fira Code', monospace;
    line-height: 1;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-shadow: 0 0 40px rgba(6, 182, 212, 0.2);
}
.light-mode .live-clock-time {
    background: linear-gradient(135deg, #0891b2, #7c3aed, #db2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.live-clock-greeting {
    font-size: 0.75rem;
    font-weight: 700;
    color: #f1f5f9;
}
.light-mode .live-clock-greeting { color: #0f172a; }

.live-clock-date {
    font-size: 0.6rem;
    color: #64748b;
    font-family: 'Courier New', 'Fira Code', monospace;
}
.light-mode .live-clock-date { color: #64748b; }

.live-clock-daycount {
    font-size: 0.55rem;
    color: #475569;
    font-family: 'Courier New', monospace;
}
.light-mode .live-clock-daycount { color: #94a3b8; }

/* ===== INSTALL BANNER ===== */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}
.light-mode .install-banner {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.08);
}
@media (min-width: 640px) {
    .install-banner {
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: 420px;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    .light-mode .install-banner {
        border-color: rgba(0, 0, 0, 0.08);
    }
}
