/* Common Styles for IVGraph */

/* Details icon rotation */
details[open] .details-icon {
    transform: rotate(45deg);
}

/* Starfield - Optimized for performance */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    will-change: contents; /* Optimize for animation */
    contain: layout style paint; /* CSS containment for performance */
}

/* Glow Blobs */
.glow-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 2;
    opacity: 0.4;
    will-change: transform, opacity;
    animation: pulse-glow 10s infinite alternate;
}

.glow-1 {
    top: -10%;
    left: 20%;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
}

.glow-2 {
    bottom: -10%;
    right: 10%;
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    animation-delay: 2s;
}

@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.1); opacity: 0.5; }
}

/* UI Components - Optimized for performance */
.magic-card {
    position: relative;
    background: rgba(19, 17, 28, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    z-index: 1;
    transition: transform 0.2s ease, background 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    will-change: transform;
    contain: layout style; /* CSS containment to reduce layout calculations */
}

.magic-card:hover {
    transform: translateY(-4px);
    background: rgba(26, 24, 37, 0.9);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.15);
}

/* Disable hover for details/accordion cards */
details.magic-card:hover {
    transform: none;
    background: rgba(19, 17, 28, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.btn-glow {
    background: linear-gradient(92.88deg, #455EB5 9.16%, #5643CC 43.89%, #673FD7 64.72%);
    box-shadow: 0 0 20px rgba(103, 63, 215, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(103, 63, 215, 0.6);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

@keyframes kofi-wiggle {
    0% {
        transform: rotate(0) scale(1);
    }
    60% {
        transform: rotate(0) scale(1);
    }
    75% {
        transform: rotate(0) scale(1.12);
    }
    80% {
        transform: rotate(0) scale(1.1);
    }
    84% {
        transform: rotate(-10deg) scale(1.1);
    }
    88% {
        transform: rotate(10deg) scale(1.1);
    }
    92% {
        transform: rotate(-10deg) scale(1.1);
    }
    96% {
        transform: rotate(10deg) scale(1.1);
    }
    100% {
        transform: rotate(0) scale(1);
    }
}

.kofi-icon {
    animation: kofi-wiggle 3.333s infinite;
}

.text-gradient {
    background: linear-gradient(to right, #A78BFA, #60A5FA);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

/* Text utilities */
.text-text-muted {
    color: rgb(156, 163, 175);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #050507; }
::-webkit-scrollbar-thumb { background: #2D2B3B; border-radius: 4px; }

/* Button padding for all screens: 10px top/bottom, 20px left/right */
.btn-secondary {
    padding: 0.625rem 1.25rem !important; /* 10px 20px */
}

.btn-glow {
    padding: 0.625rem 1.25rem !important; /* 10px 20px */
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    /* Hide Support us text on mobile only */
    .btn-secondary span:not(.kofi-icon) {
        display: none !important;
    }
    
    /* Reduce glow effects for performance */
    .glow-blob {
        opacity: 0.2;
        filter: blur(60px);
    }
}

/* Ensure Support us text is visible on tablet and desktop */
@media (min-width: 640px) {
    .btn-secondary span:not(.kofi-icon) {
        display: inline !important;
    }
}

/* Fix hover underline for links */
a.hover\:underline:hover {
    text-decoration: underline !important;
}

/* Article Content Typography - consistent with project patterns */
.article-content {
    color: #9ca3af; /* text-text-muted */
    font-size: 0.875rem; /* text-sm */
    line-height: 1.625; /* leading-relaxed */
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content h1 {
    font-size: 1.5rem !important; /* text-2xl */
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content h2 {
    font-size: 1.25rem !important; /* text-xl */
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.125rem !important; /* text-lg */
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content h4 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1rem !important;
    padding-left: 1.25rem !important; /* pl-5 */
    list-style: revert !important; /* Override Tailwind's list-style:none */
}

.article-content ul {
    list-style-type: disc !important;
}

.article-content ol {
    list-style-type: decimal !important;
}

.article-content li {
    margin-bottom: 0.25rem; /* space-y-1 */
}

.article-content li::marker {
    color: #9ca3af; /* text-text-muted - consistent with list items */
}

.article-content a {
    color: #a78bfa; /* violet-400 */
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: #c4b5fd; /* violet-300 */
    text-decoration: underline;
}

.article-content strong {
    color: #ffffff;
    font-weight: 600;
}

.article-content blockquote {
    border-left: 3px solid #8b5cf6;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #9ca3af;
    font-style: italic;
}

.article-content code {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem; /* slightly smaller than text */
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.article-content pre {
    background: rgba(19, 17, 28, 0.6); /* consistent with magic-card */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.article-content pre code {
    background: none;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.article-content img {
    border-radius: 0.5rem; /* rounded-lg */
    margin: 1rem 0;
    max-width: 100%;
    height: auto;
}

.article-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* border-white/5 */
    margin: 1.5rem 0;
}

.article-content table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.article-content th,
.article-content td {
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.article-content th {
    background: rgba(139, 92, 246, 0.1);
    color: #ffffff;
    font-weight: 600;
}

.article-content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Responsive - match project pattern sm:text-base etc */
@media (min-width: 640px) {
    .article-content {
        font-size: 1rem; /* text-base */
    }

    .article-content h1 {
        font-size: 2rem !important; /* text-3xl */
    }

    .article-content h2 {
        font-size: 1.5rem !important; /* text-2xl */
    }

    .article-content h3 {
        font-size: 1.25rem !important; /* text-xl */
    }

    .article-content h4 {
        font-size: 1.125rem !important; /* text-lg */
    }
}

