/* Custom Styles for Bulbizi */

/* Ensure smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Theme Variables */
:root {
    --bg-primary: #0f0f0f;
    --bg-card: #1a1a1a;
    --text-primary: #e0e0e0;
    --accent: #00ff41;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-card: #f5f5f5;
    --text-primary: #1a1a1a;
    --accent: #00cc33;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom scrollbar for Webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary); 
}

::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent); 
}

/* Remove default appearance for search input */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

/* Glowing text effect for the logo */
.logo-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.logo-glow span {
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.5),
                 0 0 40px rgba(0, 255, 65, 0.3),
                 0 0 60px rgba(0, 255, 65, 0.2);
}

@keyframes glow {
    from {
        filter: brightness(1);
    }
    to {
        filter: brightness(1.2);
    }
}

/* Focus effects */
input:focus {
    box-shadow: none;
}

/* Fade in animation for elements */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progress {
    0% {
        width: 0%;
        transform: translateX(0);
    }
    50% {
        width: 70%;
        transform: translateX(0);
    }
    100% {
        width: 100%;
        transform: translateX(0);
    }
}

.animate-progress {
    animation: progress 2s ease-in-out infinite;
}

main > * {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Stagger animations */
main > *:nth-child(1) { animation-delay: 0.1s; }
main > *:nth-child(2) { animation-delay: 0.2s; }
main > *:nth-child(3) { animation-delay: 0.3s; }
main > *:nth-child(4) { animation-delay: 0.4s; }

/* Site Card Styles */
.site-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    transition: left 0.5s;
}

.site-card:hover::before {
    left: 100%;
}

.site-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.2);
}

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.site-card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-primary);
}

.site-card-favorite {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    padding: 0.25rem;
}

.site-card-favorite.active {
    color: #ffd700;
}

.site-card-favorite:hover {
    color: #ffd700;
}

.site-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #888;
    margin-top: 0.5rem;
}

/* Mobile Swipe Gestures */
.swipeable {
    touch-action: pan-y;
}

/* Pull to Refresh */
#mainContent {
    position: relative;
}

.pull-to-refresh-indicator {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.pull-to-refresh-indicator.active {
    opacity: 1;
}

@keyframes spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, 
        var(--bg-card) 25%, 
        rgba(255, 255, 255, 0.05) 50%, 
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dropdown Animations */
.dropdown-enter {
    animation: slideUp 0.3s ease-out;
}

/* Dropdown Positioning */
#historyDropdown,
#favoritesDropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    z-index: 9999 !important;
}

/* Keyboard Shortcut Styles */
kbd {
    font-family: monospace;
    font-size: 0.75rem;
}

/* QR Code Modal */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.qr-modal.active {
    opacity: 1;
    pointer-events: all;
}

.qr-modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    animation: slideUp 0.3s;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .site-card {
        padding: 1rem;
    }
    
    .logo-glow {
        font-size: 3rem;
    }
}

/* Haptic Feedback (for supported devices) */
.haptic-light {
    -webkit-tap-highlight-color: rgba(0, 255, 65, 0.3);
}

/* Print Styles */
@media print {
    header, footer, #historyBtn, #favoritesBtn, #themeToggle, #langToggle {
        display: none;
    }
}
