/* Custom Styles for CosmoPulse Daily */

/* Font Family */
body {
    font-family: 'Inter', 'Space Grotesk', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
}

/* Custom Animations */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #f59e0b, #eab308);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #fbbf24, #facc15);
}

/* Line Clamp Utility */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Selection Color */
::selection {
    background-color: rgba(251, 191, 36, 0.4);
    color: white;
}

/* Focus Styles */
input:focus, textarea:focus, select:focus {
    outline: none;
    ring: 2px;
    ring-color: #f59e0b;
}

/* Backdrop Blur Support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-lg {
        backdrop-filter: blur(16px);
    }
    
    .backdrop-blur-sm {
        backdrop-filter: blur(4px);
    }
}

/* Loading Animation */
.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60% {
        content: '...';
    }
    80%, 100% {
        content: '';
    }
}

/* Article Hover Effects */
article {
    transition: all 0.3s ease;
}

article:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Button Hover Effects */
button, a[class*="bg-gradient"] {
    position: relative;
    overflow: hidden;
}

button::before, a[class*="bg-gradient"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before, a[class*="bg-gradient"]:hover::before {
    width: 300px;
    height: 300px;
}

/* Mobile Menu Animation */
#mobileMenu {
    transition: all 0.3s ease;
}

#mobileMenu.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

#mobileMenu:not(.hidden) {
    opacity: 1;
    max-height: 300px;
}

/* Page Content Fade In */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Starry Background Effect */
.starry-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 40%, white, transparent),
        radial-gradient(1px 1px at 33% 60%, white, transparent),
        radial-gradient(1px 1px at 55% 80%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: starry 20s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes starry {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

/* Gradient Text Selection */
.gradient-text {
    background: linear-gradient(135deg, #f59e0b, #eab308, #f97316);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Tilted Card Effects */
.tilt-card {
    transform: rotate(1deg);
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Staggered Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: staggerFadeIn 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow Effects */
.glow-amber {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.glow-amber:hover {
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
}

/* Backdrop Glow */
.backdrop-glow {
    position: relative;
}

.backdrop-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, rgba(251, 191, 36, 0.5), rgba(234, 179, 8, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.backdrop-glow:hover::before {
    opacity: 1;
}

