:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --rose-500: #f43f5e;
    --emerald-500: #10b981;
    --surface: #ffffff;
    --background: #f1f5f9; /* Slate 100 for better contrast with white cards */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body {
    box-sizing: border-box;
    padding-bottom: var(--safe-area-bottom);
}

header {
    padding-top: var(--safe-area-top);
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px -1px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.05); /* Added default shadow */
    border: 1px solid #e2e8f0; /* Default border */
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.15), 0 10px 10px -5px rgba(79, 70, 229, 0.04);
    border-color: #cbd5e1;
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ad-carousel-container {
    perspective: 1000px;
}

.ad-slide {
    min-width: 100%;
    transition: all 0.5s ease-in-out;
}

.toast {
    position: fixed;
    top: calc(20px + var(--safe-area-top));
    right: 20px;
    z-index: 1000;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #10b981;
}

.toast.error {
    background-color: #ef4444;
}

.toast.warning {
    background-color: #f59e0b;
}

.toast.info {
    background-color: #3b82f6;
}

.inline-warning {
    position: absolute;
    top: -45px;
    left: 0;
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    display: none;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 50;
    white-space: nowrap;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.inline-warning::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fef3c7;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(5px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@view-transition {
    navigation: auto;
}

.floating-donate-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 40;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-donate-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(79, 70, 229, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

/* Premium Hero Styles */
.hero-highlight-container {
    background: linear-gradient(135deg, #6365f1ae 0%, #8b5cf6 100%);
    border-radius: 1.5rem;
    padding: 3.5rem 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.4);
    color: white;
    text-align: center;
}

.hero-highlight-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 35c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9 61c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM16 37c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8z' fill='%23ffffff' fill-opacity='0.08' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.hero-highlight-container::after {
    content: '';
    position: absolute;
    top: -15%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 80%);
    z-index: 1;
    pointer-events: none;
}

.hero-highlight-container>* {
    position: relative;
    z-index: 2;
}

.hero-title-gradient {
    color: #ffffff;
    display: inline-block;
}

.hero-subtitle-text {
    color: #ffffff;
    opacity: 0.9;
    font-weight: 500;
}

/* ── Skeleton loader (iOS Safari / Android compatible) ── */

/* WebKit-prefixed keyframes for old iOS Safari */
@-webkit-keyframes skeleton-wave {
    0%   { -webkit-transform: translateX(-100%); transform: translateX(-100%); }
    100% { -webkit-transform: translateX(100%);  transform: translateX(100%);  }
}
@keyframes skeleton-wave {
    0%   { -webkit-transform: translateX(-100%); transform: translateX(-100%); }
    100% { -webkit-transform: translateX(100%);  transform: translateX(100%);  }
}

/* Base skeleton block — plain gray rectangle */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #e8eaf0;
    border-radius: 6px;
    /* Force GPU layer on iOS */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Shimmer wave via ::after — works on all mobile browsers */
.skeleton::after {
    content: '';
    display: block;         /* important for some older WebKit */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;              /* inset: 0 fails on old iOS — use separate props */
    background: -webkit-linear-gradient(
        left,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    -webkit-animation: skeleton-wave 1.6s ease-in-out infinite;
    animation: skeleton-wave 1.6s ease-in-out infinite;
    -webkit-transform: translateX(-100%) translateZ(0);
    transform: translateX(-100%) translateZ(0);
    will-change: transform;
}

/* Card wrapper */
.skeleton-card {
    background: #ffffff;
    border-radius: 12px;
    -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    height: 8rem;
}

@media (min-width: 640px) {
    .skeleton-card { height: 11rem; }
}

/* Left image placeholder */
.skeleton-thumb {
    width: 7rem;
    -webkit-box-flex: 0;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    background-color: #d8dce6;
    position: relative;
    overflow: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.skeleton-thumb::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: -webkit-linear-gradient(
        left,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%
    );
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 100%
    );
    -webkit-animation: skeleton-wave 1.6s ease-in-out infinite;
    animation: skeleton-wave 1.6s ease-in-out infinite;
    -webkit-transform: translateX(-100%) translateZ(0);
    transform: translateX(-100%) translateZ(0);
    will-change: transform;
}

@media (min-width: 640px) {
    .skeleton-thumb { width: 11rem; }
}

/* Right content area */
.skeleton-body {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 12px 16px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    /* gap не работает на старом Safari — используем margin */
}

/* Text-line placeholders */
.skeleton-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 8px;     /* вместо gap на родителе */
}
.skeleton-line:last-child { margin-bottom: 0; }

.skeleton-line.wide  { width: 70%; }
.skeleton-line.short { width: 40%; }
.skeleton-line.full  { width: 95%; }
.skeleton-line.half  { width: 50%; }
/* ─────────────────────────────────────────────────────── */