/* ============================================ */
/* XOIAR.com – DEGZINE v2.3 (GLOBAL STYLES)     */
/* EXTENDED: TOOLS DROPDOWN · MEGAMENU · CARDS  */
/* BRUTALIST + TACTILE · PAPER GRAIN · ANIMATED */
/* Google AdSense Compliant                     */
/* ============================================ */

/* ---------- ROOT VARIABLES – Pure Blue, Yellow, Ink ---------- */
:root {
    --xoiar-blue: #0a4b6e;
    --xoiar-blue-dark: #022b42;
    --xoiar-blue-light: #eef5ff;
    --xoiar-yellow: #f5b042;
    --xoiar-yellow-dark: #d48f2c;
    --xoiar-yellow-soft: #fff4e0;
    --ink-black: #0a0a0a;
    --paper-white: #fffef0;
    --gray-mid: #4a5b6a;
    --shadow-hard: 12px 12px 0 rgba(0, 0, 0, 0.12);
    --transition-default: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    --transition-smooth: all 0.35s ease;
    --font-mono: 'Courier New', 'Fira Code', monospace;
}

/* ---------- GLOBAL RESET – Strong Contrast ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #e3dac9;
    background-image: radial-gradient(#c0bba5 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--ink-black);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    scroll-behavior: smooth;
    position: relative;
    animation: fadeInBody 0.6s ease-out;
}

@keyframes fadeInBody {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Paper grain – heavier texture */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.75" numOctaves="1" stitchTiles="stitch"/><feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.12 0"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.25"/></svg>');
    opacity: 0.2;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
}

/* Headings – pure black ink */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #000000;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
    border-bottom: 4px solid var(--xoiar-yellow);
    display: inline-block;
    padding-bottom: 0.3rem;
}

/* Links – high contrast hover */
a {
    color: var(--xoiar-blue);
    text-decoration: none;
    transition: var(--transition-default);
    font-weight: 500;
}
a:hover {
    color: var(--xoiar-yellow-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- HEADER (brutalist sticky) ---------- */
.navbar {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--xoiar-yellow);
    padding: 0.75rem 0;
    transition: all 0.3s;
}
.navbar.scrolled {
    padding: 0.4rem 0;
    background: rgba(0, 0, 0, 0.95);
}

.navbar-brand span {
    font-weight: 800;
    font-size: 1.65rem;
    color: white;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 0 var(--xoiar-yellow);
}

.brand-logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(2px 2px 0 var(--xoiar-yellow));
}

.navbar-nav .nav-link {
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 48px;
    transition: var(--transition-default);
    color: #ffffff;
}
.navbar-nav .nav-link > i {
    color: var(--xoiar-yellow);
    margin-right: 0.25rem;
}
.navbar-nav .nav-link:hover {
    background: var(--xoiar-yellow);
    color: black;
    transform: translateY(-2px);
}
.navbar-nav .nav-link.active {
    background: var(--xoiar-yellow);
    color: black;
    border-left: 3px solid white;
}

/* ========== ENHANCED DROPDOWN MEGAMENU STYLING ========== */
.dropdown-tools {
    position: static;
}
.dropdown-tools .dropdown-menu {
    width: 100%;
    left: 0;
    right: 0;
    max-width: 1200px;
    margin: 0 auto;
    top: calc(100% + 8px);
    background: #0a0a0a;
    border-radius: 28px;
    border: 1px solid #f5b042;
    backdrop-filter: blur(12px);
    padding: 2rem 1.5rem;
    box-shadow: 0 30px 40px -15px rgba(0,0,0,0.6);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
}
.dropdown-tools.show .dropdown-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}
.tools-megamenu {
    width: 100%;
}
.tools-section {
    padding: 0 0.8rem;
}
.tools-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    color: #f5b042;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(245,176,66,0.3);
    display: inline-block;
}
.tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
    color: #f0f0f0;
    border: 1px solid transparent;
}
.tool-item i {
    width: 32px;
    font-size: 1.4rem;
    color: #f5b042;
}
.tool-item span {
    flex: 1;
    font-weight: 600;
}
.tool-item small {
    display: block;
    font-size: 0.7rem;
    color: #aaa;
}
.tool-item:hover {
    background: #f5b042;
    color: black;
    border-color: white;
    transform: translateX(6px);
}
.tool-item:hover i {
    color: black;
}
.tool-badge {
    background: #ff5722;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    margin-left: 8px;
}
@media (max-width: 992px) {
    .dropdown-tools .dropdown-menu {
        padding: 1.5rem;
        max-height: 80vh;
        overflow-y: auto;
    }
}
@media (max-width: 768px) {
    .dropdown-tools .dropdown-menu {
        background: #0a0a0a;
        border-left: 2px solid #f5b042;
    }
    .tools-section {
        margin-bottom: 1.5rem;
    }
}

/* Megamenu container – full width on large screens */
.dropdown-tools .dropdown-menu {
    width: 100%;
    left: 0;
    right: 0;
    max-width: 1400px;
    margin: 0 auto;
    top: calc(100% + 5px);
    background: #0a0a0a;
    border-radius: 28px;
    border: 1px solid var(--xoiar-yellow);
    backdrop-filter: blur(12px);
    padding: 2rem 1.5rem;
    box-shadow: 0 30px 40px -15px rgba(0,0,0,0.6);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
}

.dropdown-tools.show .dropdown-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Megamenu grid layout */
.tools-megamenu {
    width: 100%;
}
.tools-megamenu .row {
    margin: 0;
}
.tools-section {
    padding: 0 0.8rem;
}
.tools-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    color: var(--xoiar-yellow);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(245,176,66,0.3);
    display: inline-block;
}
.tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 0.5rem;
    transition: var(--transition-default);
    text-decoration: none;
    color: #f0f0f0;
    border: 1px solid transparent;
}
.tool-item i {
    width: 32px;
    font-size: 1.4rem;
    color: var(--xoiar-yellow);
}
.tool-item span {
    flex: 1;
    font-weight: 600;
}
.tool-item small {
    display: block;
    font-size: 0.7rem;
    color: #aaa;
}
.tool-item:hover {
    background: var(--xoiar-yellow);
    color: black;
    border-color: white;
    transform: translateX(6px);
}
.tool-item:hover i {
    color: black;
}
.tool-item:hover small {
    color: #1e2a1a;
}

/* Badges for new/hot tools */
.tool-badge {
    background: #ff5722;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    letter-spacing: 0.5px;
    margin-left: 8px;
    text-transform: uppercase;
}

/* ---------- TOOLS PAGE SPECIFIC STYLES (Dictionary, Converters, etc.) ---------- */
.tools-hero {
    background: linear-gradient(135deg, #f8f3e0, #f1edd9);
    padding: 3rem 2rem;
    border-radius: 40px;
    margin-bottom: 3rem;
    border: 2px solid var(--xoiar-yellow);
    text-align: center;
}
.tool-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}
.tool-card {
    background: var(--paper-white);
    border-radius: 28px;
    padding: 1.8rem;
    border: 1px solid rgba(245,176,66,0.3);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-hard);
}
.tool-card:hover {
    transform: translateY(-8px);
    border-color: var(--xoiar-yellow);
    box-shadow: 20px 20px 0 rgba(0,0,0,0.08);
}
.tool-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    display: inline-block;
    background: #fce9c4;
    padding: 0.8rem;
    border-radius: 32px;
    color: var(--xoiar-blue);
}
.tool-card h3 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}
.tool-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #6b5a3e;
    border-top: 1px dashed #ccc;
    padding-top: 0.8rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
}

/* Search box inside tools */
.tool-search {
    background: white;
    border-radius: 60px;
    border: 1px solid #cbd5e0;
    padding: 0.5rem 1.2rem;
    transition: var(--transition-default);
}
.tool-search:focus-within {
    border-color: var(--xoiar-yellow);
    box-shadow: 0 0 0 3px rgba(245,176,66,0.2);
}
.tool-search input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0.7rem 0;
    font-size: 1rem;
}
.tool-search input:focus {
    outline: none;
}
.tool-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}
.filter-chip {
    background: #e7e3d4;
    border-radius: 60px;
    padding: 0.4rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}
.filter-chip.active, .filter-chip:hover {
    background: var(--xoiar-yellow);
    color: black;
    border-color: black;
    transform: translateY(-2px);
}

/* AdSense safe – no sticky ads inside content, only designated zones */
.ad-container {
    max-width: 100%;
    overflow: hidden;
    text-align: center;
    background: rgba(255,255,245,0.6);
    border-radius: 24px;
    padding: 1rem;
    margin: 2rem 0;
    border: 1px dashed #aaa;
}
.ad-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #4a5b6a;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

/* ---------- CARDS – ink bleed on hover (updated) ---------- */
.card,
.blog-card,
.game-card,
.entry-card,
.info-card,
.urdu-card {
    background: var(--paper-white);
    border: 1px solid rgba(245, 176, 66, 0.3);
    border-radius: 24px;
    padding: 1.5rem;
    transition: var(--transition-default);
    box-shadow: var(--shadow-hard);
    animation: slideUp 0.5s ease-out backwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover,
.blog-card:hover,
.game-card:hover,
.entry-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: var(--xoiar-yellow);
    box-shadow: 18px 18px 0 rgba(0, 0, 0, 0.1);
    background: #fffcf0;
}

/* ---------- BUTTONS – ink stamp + pulse animation ---------- */
.btn,
.btn-main,
.submit-btn,
.featured-game-btn,
.degzine-blog-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--xoiar-yellow), var(--xoiar-yellow-dark));
    color: black;
    font-weight: 800;
    padding: 0.8rem 2rem;
    border: 2px solid black;
    border-radius: 60px;
    cursor: pointer;
    transition: var(--transition-default);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before,
.btn-main::before,
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.5s;
}
.btn:hover::before,
.btn-main:hover::before,
.submit-btn:hover::before {
    left: 100%;
}

.btn:hover,
.btn-main:hover,
.submit-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, var(--xoiar-yellow-dark), #c47d20);
    color: white;
    border-color: white;
}

/* Pulse animation for important buttons */
.featured-game-btn {
    animation: subtlePulse 2s infinite;
}
@keyframes subtlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ---------- FORMS – clean ink ---------- */
.form-control {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 2px solid #cbd5e0;
    border-radius: 16px;
    background: white;
    transition: var(--transition-default);
    color: black;
}
.form-control:focus {
    border-color: var(--xoiar-yellow);
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 176, 66, 0.3);
    background: #fffff5;
}
label {
    font-weight: 700;
    color: black;
    margin-bottom: 0.5rem;
    display: block;
}

/* ---------- DEGZINE SPECIALS – brutalist, animated ---------- */
.degzine-container {
    border: 3px solid #1e2e1a;
    background: var(--paper-white);
    box-shadow: var(--shadow-hard);
    position: relative;
    animation: borderGlow 3s infinite alternate;
}
@keyframes borderGlow {
    0% { border-color: #1e2e1a; box-shadow: var(--shadow-hard); }
    100% { border-color: var(--xoiar-yellow); box-shadow: 20px 20px 0 rgba(0, 0, 0, 0.15); }
}

.degzine-container::before {
    content: "";
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border: 2px dashed #9e7e5e;
    pointer-events: none;
}

.archive-stamp {
    display: inline-block;
    border: 3px double #703030;
    color: #703030;
    background: #fff3e4;
    font-size: 0.75rem;
    padding: 0.3rem 1rem;
    transform: rotate(-1deg);
    font-weight: 800;
    letter-spacing: 2px;
    animation: stampShake 6s infinite ease-in-out;
}
@keyframes stampShake {
    0%, 100% { transform: rotate(-1deg) translateX(0); }
    50% { transform: rotate(1deg) translateX(2px); }
}

.pullquote {
    font-size: 1.6rem;
    font-weight: 800;
    border-top: 6px solid black;
    border-bottom: 6px solid black;
    padding: 1.2rem 2rem;
    background: #faf5cf;
    text-transform: uppercase;
    margin: 2rem 0;
    transition: all 0.3s;
}
.pullquote:hover {
    background: #fff3b0;
    transform: scale(1.01);
}

.ascii-art {
    font-family: 'Courier New', monospace;
    background: #d2d8b6;
    padding: 1rem;
    border: 3px solid #131f0c;
    white-space: pre;
    overflow-x: auto;
    margin: 1.5rem 0;
    filter: drop-shadow(4px 4px 0 #8a7a5a);
}

/* ---------- RESPONSIVE + ANIMATIONS DELAYS ---------- */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

@media (max-width: 992px) {
    h1 { font-size: 2rem; }
    .page-title { font-size: 1.8rem; }
    .card, .blog-card, .game-card { padding: 1.2rem; }
    .dropdown-tools .dropdown-menu {
        padding: 1.5rem;
        max-height: 80vh;
        overflow-y: auto;
    }
    .tool-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}
@media (max-width: 768px) {
    body { padding-top: 85px; }
    .navbar-nav .nav-link { padding: 0.5rem 0.8rem; }
    .dropdown-menu { background: black; border-left: 2px solid var(--xoiar-yellow); }
    .pullquote { font-size: 1rem; }
    .tools-megamenu .col-md-4 {
        margin-bottom: 1.5rem;
    }
}
@media (max-width: 576px) {
    .btn, .btn-main { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
    .archive-stamp { font-size: 0.65rem; }
    .tool-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- ACCESSIBILITY & ADSENSE SAFETY ---------- */
:focus {
    outline: 3px solid var(--xoiar-yellow);
    outline-offset: 3px;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Ensure no content overlaps ads */
.ad-container ins, .ad-container iframe {
    max-width: 100%;
    margin: 0 auto;
}