/* ========================================
   JAIN JINVANI - UTILITY STYLES
   Animations, dark mode, helpers
   ======================================== */

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.slide-in-left {
    opacity: 0;
    animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
    opacity: 0;
    animation: slideInRight 0.6s ease forwards;
}

.scale-in {
    opacity: 0;
    animation: scaleIn 0.5s ease forwards;
}

/* Stagger Animation Container */
.stagger-container .stagger-item {
    opacity: 1;
    /* Visible by default, animation enhances if JS loads */
}

.stagger-container.animated .stagger-item {
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-container.animated .stagger-item:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-container.animated .stagger-item:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-container.animated .stagger-item:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-container.animated .stagger-item:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-container.animated .stagger-item:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-container.animated .stagger-item:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger-container.animated .stagger-item:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger-container.animated .stagger-item:nth-child(8) {
    animation-delay: 0.4s;
}

.stagger-container.animated .stagger-item:nth-child(9) {
    animation-delay: 0.45s;
}

.stagger-container.animated .stagger-item:nth-child(10) {
    animation-delay: 0.5s;
}

.stagger-container.animated .stagger-item:nth-child(n+11) {
    animation-delay: 0.55s;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1E1E1E;
    --bg-accent: #2D2D2D;
    --cream-bg: #252525;
    --warm-cream: #1A1A1A;
    --warm-white: #202020;

    --text-title: #F5F5F5;
    --text-body: #E0E0E0;
    --text-muted: #A0A0A0;
    --text-light: #707070;
    --text-dark: #FFFFFF;

    --kumkum-red: #E53935;
    --kumkum-red-light: #EF5350;
    --deep-maroon: #FFAB91;

    --shadow-soft: 0 2px 13px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 5px 21px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 8px 34px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .panchang-main,
[data-theme="dark"] .auspicious-times,
[data-theme="dark"] .upcoming-parva {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .category-link,
[data-theme="dark"] .content-list li {
    background: var(--bg-secondary);
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .sidebar {
    background: var(--bg-secondary);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .mobile-bottom-nav {
    background: var(--bg-secondary);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .mobile-more-content {
    background: var(--bg-secondary);
}

[data-theme="dark"] .intro-box {
    background: var(--bg-accent);
}

[data-theme="dark"] .hindi-arth {
    background: var(--bg-accent);
}

[data-theme="dark"] .stotra-block {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .panchang-item {
    background: var(--bg-accent);
}

/* ===== Font Size Utilities ===== */
[data-font-size="normal"] {
    font-size: 16px;
}

[data-font-size="large"] {
    font-size: 18px;
}

[data-font-size="xlarge"] {
    font-size: 20px;
}

[data-font-size="large"] .sanskrit-verse,
[data-font-size="large"] .content-list li .title {
    font-size: 1.4rem;
}

[data-font-size="xlarge"] .sanskrit-verse,
[data-font-size="xlarge"] .content-list li .title {
    font-size: 1.5rem;
}

/* ===== Spacing Utilities ===== */
.mt-0 {
    margin-top: 0;
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.py-sm {
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.py-md {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}

.py-lg {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}

.py-xl {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.px-sm {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

.px-md {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.px-lg {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

.px-xl {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
}

/* ===== Text Utilities ===== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--kumkum-red);
}

.text-gold {
    color: var(--gold);
}

.text-muted {
    color: var(--text-muted);
}

.text-white {
    color: white;
}

.font-devanagari {
    font-family: var(--font-devanagari);
}

.font-heading {
    font-family: var(--font-heading);
}

.font-serif {
    font-family: var(--font-serif);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

/* ===== Display Utilities ===== */
.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.d-mobile-only {
    display: none;
}

.d-desktop-only {
    display: block;
}

@media (max-width: 1024px) {
    .d-mobile-only {
        display: block;
    }

    .d-desktop-only {
        display: none;
    }
}

/* ===== Loading State ===== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-accent);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--kumkum-red);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--bg-accent);
}

/* ===== Print Styles ===== */
@media print {

    .sidebar,
    .mobile-bottom-nav,
    .mobile-more-overlay,
    .mobile-toggle,
    .hero-buttons,
    .back-link {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* ========================================
   JAIN JINVANI - 3D ICONOGRAPHY
   Microsoft Fluent 3D Emoji Styling
   ======================================== */

.icon-3d {
    display: inline-block;
    vertical-align: middle;
    width: 1.4em;
    /* Slightly larger than text for impact */
    height: 1.4em;
    object-fit: contain;

    /* Adds depth and separates from background */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));

    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Springy hover */
}

/* Size Variants */
.icon-sm {
    width: 1.2em;
    height: 1.2em;
}

.icon-md {
    width: 24px;
    height: 24px;
}

.icon-lg {
    width: 48px;
    height: 48px;
}

.icon-xl {
    width: 64px;
    height: 64px;
}

/* Hover Effect */
.feature-card:hover .icon-3d,
.category-row:hover .icon-3d,
.sidebar-item:hover .icon-3d,
.principle-item:hover .icon-3d {
    transform: scale(1.2) translateY(-2px);
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.2));
}

/* Specific Adjustments for Icon Alignment */
h1 .icon-3d,
h2 .icon-3d,
h3 .icon-3d {
    margin-right: 8px;
    vertical-align: text-bottom;
}

/* ========================================
   3D EMOJI IMAGES (CDN-based)
   ======================================== */

.emoji-3d {
    display: inline-block;
    vertical-align: middle;
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        filter 0.3s ease;
}

/* Size Variants for emoji-3d */
.emoji-sm {
    width: 16px;
    height: 16px;
}

.emoji-md {
    width: 24px;
    height: 24px;
}

.emoji-lg {
    width: 32px;
    height: 32px;
}

.emoji-xl {
    width: 48px;
    height: 48px;
}

.emoji-xxl {
    width: 64px;
    height: 64px;
}

/* Navigation/Header Icons */
.mobile-nav-icon .emoji-3d,
.mobile-pref-icon .emoji-3d,
.mobile-more-icon .emoji-3d {
    width: 22px;
    height: 22px;
}

/* Category Headers */
.category-header .emoji-3d,
.section-title .emoji-3d,
h2 .emoji-3d,
h3 .emoji-3d,
h4 .emoji-3d {
    width: 1.1em;
    height: 1.1em;
    margin-right: 6px;
    vertical-align: -0.15em;
}

/* Hover Animations */
.emoji-3d:hover,
a:hover .emoji-3d,
button:hover .emoji-3d,
.mobile-nav-item:hover .emoji-3d,
.mobile-more-link:hover .emoji-3d {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

/* Active State */
.mobile-nav-item.active .emoji-3d {
    transform: scale(1.1);
    filter: drop-shadow(0 3px 6px rgba(183, 110, 0, 0.3));
}

/* Pulse Animation for Special Icons */
@keyframes emoji-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.emoji-pulse {
    animation: emoji-pulse 2s ease-in-out infinite;
}

/* Floating Animation */
@keyframes emoji-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.emoji-float {
    animation: emoji-float 3s ease-in-out infinite;
}

/* Inline text emoji alignment */
p .emoji-3d,
span .emoji-3d,
li .emoji-3d {
    vertical-align: -0.1em;
    margin: 0 2px;
} /* ========================================
   JAIN JINVANI - INTERACTIONS & ANIMATIONS
   Micro-interactions, keyframes, and motion design
   ======================================== */

/* ===== 1. Hover Effects (The "Lift") ===== */
.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    will-change: transform, box-shadow;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* ===== 2. Click Effects (The "Press") ===== */
.click-press {
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.click-press:active {
    transform: scale(0.96);
}

/* ===== 3. Loading States (Skeletal Shimmer) ===== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-accent) 25%,
            var(--bg-secondary) 50%,
            var(--bg-accent) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
    display: inline-block;
    color: transparent !important;
    pointer-events: none;
}

.skeleton-text {
    height: 1em;
    width: 80%;
    margin-bottom: var(--space-xs);
}

.skeleton-img {
    width: 100%;
    height: 200px;
    background-color: var(--bg-accent);
}

/* ===== 4. Toast Notifications (Entrance/Exit) ===== */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
}

.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
    /* Allow clicks through empty space */
}

.toast {
    pointer-events: auto;
    background: white;
    color: var(--text-heading);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    border-left: 4px solid var(--primary-saffron);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 250px;
    animation: toastSlideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.toast.hiding {
    animation: toastSlideOut 0.2s cubic-bezier(0.6, -0.28, 0.74, 0.05) forwards;
}

.toast-icon {
    font-size: 1.25rem;
}

/* Skeleton Specifics */
.skeleton-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

.skeleton-item .search-result-icon.skeleton {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-color: var(--bg-accent);
}

/* ===== 5. Page Transitions (Subtle Fade Up) ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}
