/*
Theme Name: Gate of AI v4
Theme URI: https://gateofai.com
Author: Gate of AI Team
Author URI: https://gateofai.com
Description: A clean, white modern WordPress theme for AI Tools & Tutorials.
Version: 4.2.1
Text Domain: gateofai
*/

/* Variables - Light Mode Modern */
:root {
    --bg-color: #F8FAFC;
    /* Slate-50 - Very light grey/white */
    --card-bg: #FFFFFF;
    /* Pure white cards */
    --text-color: #1E293B;
    /* Slate-800 - Dark readable text */
    --text-muted: #64748B;
    /* Slate-500 */
    --accent-color: #4F46E5;
    /* Indigo-600 - Professional modern blue/purple */
    --accent-hover: #4338CA;
    /* Indigo-700 */
    --secondary-accent: #0EA5E9;
    /* Sky-500 */
    --border-color: #E2E8F0;
    /* Slate-200 */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --font-primary: 'Cairo', 'Inter', sans-serif;
    --font-heading: 'Cairo', 'Inter', sans-serif;
    --container-width: 1200px;
}

/* Global Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: #F8FAFC !important;
    color: #1E293B !important;
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 16px;
    direction: rtl;
}

/* FORCE white backgrounds - override any inline dark styles from old content */
#page,
.site,
.site-main,
main,
article,
.entry-content,
.single-ai-tool,
.single-tutorial,
.tool-content-wrapper,
.tool-main-content,
.tool-sidebar {
    background-color: #FFFFFF !important;
    color: #1E293B !important;
}

/* Override any inline dark backgrounds on divs inside content */
.entry-content *,
.tool-main-content *,
.single-ai-tool *,
.single-tutorial * {
    background-color: transparent !important;
    color: inherit !important;
}

/* Restore specific component styles that need non-transparent backgrounds */
.entry-content img,
.tool-featured-image img {
    background-color: #F1F5F9 !important;
}

.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
}

.entry-content table th {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    text-align: right;
    font-weight: 700;
}

.entry-content table td {
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    color: #334155 !important;
    background-color: #FFFFFF !important;
}

.entry-content table tr:nth-child(even) td {
    background-color: #F8FAFC !important;
}

/* Override inline heading colors */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: #0F172A !important;
    background: transparent !important;
}

/* Override inline paragraph and span colors */
.entry-content p,
.entry-content span,
.entry-content li,
.entry-content blockquote {
    color: #334155 !important;
    background: transparent !important;
}

/* Override inline link colors */
.entry-content a {
    color: #4F46E5 !important;
    background: transparent !important;
}

.entry-content a:hover {
    color: #4338CA !important;
}

/* Restore badge, button, and card backgrounds */
.ai-tool-badge {
    background: #FFFFFF !important;
    color: #4F46E5 !important;
}

.btn-primary {
    background: #4F46E5 !important;
    color: #FFFFFF !important;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2);
    filter: brightness(1.1);
}

.btn-secondary {
    background: #FFFFFF !important;
    color: #1E293B !important;
}

.registration-wall {
    background: #FFFFFF !important;
}

.content-blur {
    background: transparent !important;
}

/* Restore card backgrounds */
.ai-tool-card,
.tutorial-card {
    background: #FFFFFF !important;
    color: #1E293B !important;
}

.ai-tool-image-wrapper,
.tutorial-thumb,
.ai-tool-placeholder {
    background-color: #F1F5F9 !important;
}

.stat-number {
    color: #4F46E5 !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: #0F172A;
    /* Slate-900 */
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Clean White Modern 3-Column RTL */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.65rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.header-container {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    align-items: center;
    direction: rtl;
    gap: 1rem;
}

.site-branding {
    display: flex;
    justify-content: flex-start;
}

.site-title {
    margin: 0;
}

.site-title a {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.main-navigation {
    display: flex;
    justify-content: center;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-navigation a {
    color: #475569;
    /* Slate-600 */
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
    position: relative;
    white-space: nowrap;
}

.main-navigation a:hover {
    color: var(--accent-color);
}

/* Modern hover underline */
.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.main-navigation a:hover::after {
    width: 100%;
}

.header-auth {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    /* Prevent stacking */
}

.header-auth .btn {
    font-size: 0.8rem;
    padding: 0.45rem 1rem;
    white-space: nowrap;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1200px) {
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .site-branding {
        flex: 1;
        order: 1;
        justify-content: flex-start;
    }

    .header-auth {
        flex: 0 0 auto;
        order: 2;
    }

    .main-navigation {
        flex: 0 0 auto;
        order: 3;
        display: flex;
        justify-content: flex-end;
    }

    .menu-toggle {
        display: flex !important;
        background: #F8FAFC;
        border: 1px solid var(--border-color);
        color: var(--text-color);
        padding: 10px;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .menu-toggle:hover {
        background: #F1F5F9;
        border-color: var(--accent-color);
    }

    .nav-menu {
        display: none;
    }

    .main-navigation.toggled .nav-menu {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #FFFFFF;
        padding: 1.5rem 24px;
        border-bottom: 2px solid var(--accent-color);
        box-shadow: var(--shadow-xl);
        z-index: 1000;
        gap: 0;
        animation: slideDown 0.3s ease-out;
    }

    .main-navigation.toggled .nav-menu li {
        width: 100%;
    }

    .main-navigation.toggled .nav-menu li a {
        display: block;
        padding: 1rem 0;
        width: 100%;
        border-bottom: 1px solid #F1F5F9;
        font-size: 1.1rem;
    }

    .main-navigation.toggled .nav-menu li a::after {
        display: none;
    }
}

@media (max-width: 600px) {
    .header-container {
        display: flex;
        justify-content: space-between;
    }

    .header-auth {
        display: none;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section - Light & Clean */
.hero-section {
    position: relative;
    padding: 6rem 0;
    text-align: center;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    /* Subtle modern pattern */
    background-image: radial-gradient(#E2E8F0 1px, transparent 1px);
    background-size: 32px 32px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #0F172A;
}

.highlight-text {
    color: var(--accent-color);
    position: relative;
    z-index: 1;
}

.highlight-text::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 12px;
    background: rgba(79, 70, 229, 0.1);
    /* Soft highlight */
    z-index: -1;
    transform: rotate(-1deg);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-color);
    color: #FFFFFF;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
    color: #FFFFFF;
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    background: #F8FAFC;
    color: #0F172A;
}

/* Stats Section */
.stats-section {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 4rem 0;
    background: #FFFFFF;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.stat-box {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections & Grid */
.section-container {
    padding: 4rem 0;
}

.bg-alt {
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0;
    position: relative;
    padding-right: 16px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 4px;
    background: var(--secondary-accent);
    border-radius: 2px;
}

.view-all-link {
    font-size: 0.95rem;
    font-weight: 700;
}

.ai-tools-grid,
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Cards - White Modern */
.ai-tool-card,
.tutorial-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 5px solid red !important;
}

.ai-tool-card:hover,
.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.ai-tool-image-wrapper,
.tutorial-thumb {
    height: 200px;
    background-color: #F1F5F9;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.ai-tool-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ai-tool-card:hover .ai-tool-image-wrapper img {
    transform: scale(1.05);
}

.ai-tool-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FFFFFF;
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.ai-tool-content,
.tutorial-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ai-tool-title,
.tutorial-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.ai-tool-title a,
.tutorial-title a {
    color: #0F172A;
    transition: color 0.2s;
}

.ai-tool-title a:hover,
.tutorial-title a:hover {
    color: var(--accent-color);
}

.ai-tool-excerpt,
.tutorial-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.ai-tool-footer,
.tutorial-footer {
    padding-top: 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-link {
    font-weight: 700;
    font-size: 0.9rem;
}

/* Footer */
.site-footer {
    background: #FFFFFF;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: var(--text-muted);
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-color);
    margin: 0;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copyright p {
    margin: 0;
    font-size: 0.85rem;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 3rem;
    text-align: center;
}

.pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 6px;
    background: #FFFFFF;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover,
.nav-links .page-numbers.current,
.nav-links .page-numbers:hover {
    background: var(--accent-color);
    color: #FFFFFF;
    border-color: var(--accent-color);
}

/* Content Lock Overlay */
.content-lock-wrapper {
    position: relative;
}

.content-blur {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
    max-height: 120px;
    overflow: hidden;
}

.registration-wall {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.registration-wall h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.registration-wall p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.wall-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-color);
}

/* Single Post Layout */
.tool-content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.entry-content h2,
.entry-content h3 {
    margin-top: 2rem;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content img {
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .stats-section {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .ai-tools-grid,
    .tutorials-grid {
        grid-template-columns: 1fr;
    }

    .tool-content-wrapper {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: block;
    }

    .main-navigation .main-nav {
        display: none;
    }

    .main-navigation.toggled .main-nav {
        display: block;
    }

    .main-navigation.toggled .nav-menu {
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #FFFFFF;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        padding: 1rem 24px;
    }

    .main-navigation.toggled .nav-menu li a {
        padding: 0.75rem 0;
        display: block;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
}