/**
 * Oyaam Premium Design System
 * Base: Bootstrap 5.3 + Custom Premium Skin
 */

:root {
    --ot-primary: #7c3aed;
    --ot-primary-rgb: 124, 58, 237;
    --ot-bg: #0f172a;
    --ot-surface: #1e293b;
    --ot-surface-light: #334155;
    --ot-text: #f8fafc;
    --ot-text-secondary: #cbd5e1;
    /* Slate 300 - Higher contrast for body text in boxes */
    --ot-text-muted: #94a3b8;
    /* Slate 400 - Optimized for secondary labels */
    --ot-border: rgba(255, 255, 255, 0.1);
    --ot-glass: rgba(30, 41, 59, 0.7);
    --ot-radius: 12px;
    --ot-font-display: 'Outfit', sans-serif;
    --ot-font-body: 'Inter', sans-serif;
}

/* Light Mode Variables Overlay */
[data-bs-theme="light"] {
    --ot-bg: #f8fafc;
    --ot-surface: #ffffff;
    --ot-surface-light: #f1f5f9;
    --ot-text: #000000;
    --ot-text-secondary: #000000;
    --ot-text-muted: #1e293b;
    --ot-border: rgba(0, 0, 0, 0.1);
    --ot-glass: rgba(255, 255, 255, 0.9);
}

body {
    background-color: var(--ot-bg);
    color: var(--ot-text);
    font-family: var(--ot-font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
.display-font {
    font-family: var(--ot-font-display);
    font-weight: 700;
}

[lang="ar"],
[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4,
[lang="ar"] .display-font {
    font-family: 'Tajawal', sans-serif !important;
}

/* Glassmorphism Header */
.navbar {
    background: var(--ot-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ot-border);
    padding: 0.75rem 0;
}

.nav-brand-text {
    font-family: var(--ot-font-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.nav-brand-accent {
    color: var(--ot-primary);
}

/* Hero Section */
.hero-section {
    padding: 100px 0 60px;
    background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.1), transparent);
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    color: var(--ot-text-muted);
    font-size: 1.25rem;
}

/* Tool Bento Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

@media (max-width: 576px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.25rem;
    }
}

.tool-card {
    background: var(--ot-surface);
    border: 1px solid var(--ot-border);
    border-radius: var(--ot-radius);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--ot-text);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.5s ease-out;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--ot-primary);
    box-shadow: 0 10px 40px -10px rgba(124, 58, 237, 0.3);
    color: var(--ot-text);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: rgba(var(--ot-primary-rgb), 0.1);
    color: var(--ot-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--ot-text-muted);
    margin: 0;
}

/* Workspace Patterns */
.tool-workspace {
    background: var(--ot-surface);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--ot-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.input-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ot-text-muted);
    margin-bottom: 0.75rem;
    display: block;
}

textarea,
input[type="text"],
.form-control {
    background: var(--ot-bg) !important;
    border: 1px solid var(--ot-border) !important;
    color: var(--ot-text) !important;
    border-radius: 8px !important;
    padding: 1rem !important;
}

textarea:focus,
input:focus {
    border-color: var(--ot-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--ot-primary-rgb), 0.2) !important;
}

.btn-primary {
    background-color: var(--ot-primary);
    border-color: var(--ot-primary);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--ot-primary-dark);
    transform: translateY(-1px);
}

/* Category Badges */
.category-btn {
    background: transparent;
    border: 1px solid var(--ot-border);
    color: var(--ot-text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.category-btn.active,
.category-btn:hover {
    background: var(--ot-primary);
    color: white;
    border-color: var(--ot-primary);
}

/* Contrast Enhancements for Readability */
.text-secondary {
    color: var(--ot-text-secondary) !important;
}

.text-muted {
    color: var(--ot-text-muted) !important;
}

/* Intelligence Cards - Heading Brightness */
.bg-white.bg-opacity-5 h4,
.bg-white.bg-opacity-5 h5,
.bg-white.bg-opacity-5 .h4,
.bg-white.bg-opacity-5 .h5 {
    color: #ffffff !important;
}

.bg-white.bg-opacity-5 p.text-muted,
.bg-white.bg-opacity-5 p.text-secondary {
    color: var(--ot-text-secondary) !important;
    /* Force higher contrast inside these boxes */
}

/* Utility Hidden Classes */
.hidden {
    display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--ot-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--ot-surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ot-primary);
}

/* Contrast Enhancements for Light Mode Readability */
[data-bs-theme="light"] .tool-card h3,
[data-bs-theme="light"] .tool-card h5,
[data-bs-theme="light"] .tool-card p,
[data-bs-theme="light"] .tool-workspace h1,
[data-bs-theme="light"] .tool-workspace h3,
[data-bs-theme="light"] .tool-workspace h4,
[data-bs-theme="light"] .tool-workspace h5,
[data-bs-theme="light"] .tool-workspace p,
[data-bs-theme="light"] .metric-card div,
[data-bs-theme="light"] .input-label,
[data-bs-theme="light"] .hero-subtitle,
[data-bs-theme="light"] .breadcrumb-item,
[data-bs-theme="light"] .text-muted:not(.hero-subtitle) {
    color: #000000 !important;
}

[data-bs-theme="light"] .metric-card .h2 {
    color: var(--ot-primary) !important;
}

/* Ensure Related Tools header is visible in light mode */
[data-bs-theme="light"] section h3 {
    color: #000000 !important;
}