* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #fafcff;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    padding: 40px 24px 80px;
    color: #1a2c3e;
    transition: background 0.3s ease;
}

/* Smooth container */
.container {
    max-width: 1300px;
    margin: 0 auto;
}

/* applied theme classes (rtl/ltr support) */
.rtl-text {
    direction: rtl;
    text-align: right;
}
.rtl-text * {
    direction: rtl;
    text-align: right;
}
.rtl-text pre, .rtl-text code, .rtl-text pre *, .rtl-text code * {
    direction: ltr !important;
    text-align: left !important;
}
.ltr-text {
    direction: ltr;
    text-align: left;
}

/* markdown-body table overrides */
.markdown-body table {
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-collapse: collapse;
}
table { width: auto; }
.markdown-body th, .markdown-body td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
}
.markdown-body th { background-color: #f8f9fa; }
.markdown-body table { direction: ltr; }

:root {
    --primary-blue: #0078ff;
    --light-blue: #e6f2ff;
    --shadow: 0 4px 15px rgba(0, 120, 255, 0.1);
    --border-color: #d1e3ff;
    --card-radius: 24px;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--primary-blue), transparent);
    margin: 50px 0;
    position: relative;
    overflow: visible;
}
hr::after {
    content: "✦";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 0 15px;
    color: var(--primary-blue);
    font-size: 18px;
}

/* heading style from theme with underline effect */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 40px;
    padding: 0 10px;
    font-size: 2.2rem;
    font-weight: 700;
    color: #0a2540;
    z-index: 1;
}
.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 60%;
    background: #0078ff;
    opacity: 0.15;
    z-index: -1;
    clip-path: polygon(0% 15%, 15% 0%, 85% 10%, 100% 5%, 95% 80%, 80% 100%, 20% 90%, 0% 95%);
    filter: blur(2px);
    transition: all 0.4s ease;
}
.section-title:hover::after {
    opacity: 0.25;
    transform: scaleX(1.05) skewX(-2deg);
}

/* ----- LANGUAGE SWITCHER - MODERN GLASS TOGGLE ----- */
.lang-switch {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
    position: relative;
    z-index: 20;
}
.toggle-glass {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    border-radius: 100px;
    padding: 6px;
    display: inline-flex;
    gap: 8px;
    border: 1px solid rgba(0, 120, 255, 0.25);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.lang-btn {
    padding: 10px 24px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    font-family: inherit;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lang-btn i {
    font-size: 1rem;
    transition: transform 0.2s;
}
.lang-btn.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.3);
}
.lang-btn:not(.active):hover {
    background: rgba(0, 120, 255, 0.1);
    transform: translateY(-2px);
}

/* page transition overlay effect */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,120,255,0.2) 0%, rgba(255,255,255,0.95) 100%);
    backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}
.page-transition-overlay.active {
    opacity: 1;
    pointer-events: none;
}

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    margin: 40px 0 20px;
}

/* interactive card design */
.tool-card {
    background: #ffffff;
    border-radius: var(--card-radius);
    border-inline-start: 4px solid var(--primary-blue);
    padding: 28px 20px 24px;
    transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: 0 8px 20px rgba(0, 120, 255, 0.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.tool-card:hover {
    transform: translateY(-8px) translateX(calc(var(--dir, 1) * -4px));
    box-shadow: 0 20px 30px rgba(0, 120, 255, 0.18);
    background-color: #f0f7ff;
    border-inline-start-color: #005fcc;
}
body[dir="ltr"] .tool-card:hover {
    --dir: -1;
}
body[dir="rtl"] .tool-card:hover {
    --dir: 1;
}
.card-icon {
    font-size: 3.2rem;
    margin-bottom: 20px;
    color: var(--primary-blue);
    transition: transform 0.2s;
}
.tool-card:hover .card-icon {
    transform: scale(1.05);
}
.card-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #0a2b44, #0078ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.card-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #2c3e4e;
    margin-bottom: 24px;
    flex: 1;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #0078ff;
    margin-top: 8px;
    border-top: 1px solid rgba(0, 120, 255, 0.2);
    padding-top: 16px;
}
.card-meta i {
    font-size: 0.9rem;
}
.card-link-hint {
    margin-left: auto;
    background: rgba(0, 120, 255, 0.1);
    padding: 5px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.2s;
}
.tool-card:hover .card-link-hint {
    background: #0078ff;
    color: white;
}
.card-badge {
    position: absolute;
    top: 18px;
    right: 20px;
    background: linear-gradient(105deg, #ff6a3d, #ff3e6c);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* author thank card */
.author-thank-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 120, 255, 0.12);
    padding: 22px 25px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 120, 255, 0.04);
    position: relative;
    max-width: 400px;
    margin: 40px auto 20px auto !important;
    animation: floatingCard 4s ease-in-out infinite;
    transition: all 0.3s ease;
    text-align: center;
}
.author-thank-card:hover {
    border-color: rgba(0, 120, 255, 0.35);
    box-shadow: 0 12px 35px rgba(0, 120, 255, 0.12);
}
.avatar-wrapper {
    position: relative;
    width: 75px;
    height: 75px;
    margin: 0 auto 12px auto;
}
.avatar-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 120, 255, 0.2);
    z-index: -1;
    animation: pulseGlow 2s ease-out infinite;
}
.author-name {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}
.thank-text {
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    line-height: 1.6;
    margin: 0;
}
@keyframes floatingCard {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}
@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.25); opacity: 0; }
}
.hero-quote {
    background: linear-gradient(to right, rgba(0, 120, 255, 0.05), transparent);
    border-inline-start: 5px solid #0078ff;
    padding: 20px 28px;
    border-radius: 12px;
    margin: 20px 0 40px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2c3e50;
    transition: all 0.3s;
}
.footer-note {
    text-align: center;
    margin-top: 60px;
    font-size: 0.85rem;
    color: #6c86a3;
    border-top: 1px solid #e2edff;
    padding-top: 30px;
}
@media (max-width: 680px) {
    body { padding: 24px 18px; }
    .card-title { font-size: 1.4rem; }
    .cards-grid { gap: 20px; }
    .lang-btn { padding: 6px 16px; }
}

/* animation for fade-in during lang switch */
.fade-text {
    transition: opacity 0.18s ease;
}