/*
 * Utilify Custom Theme CSS
 * أزرار 2563EB | Inter Font | Hero أبيض مع نص غامق
 */

/* ===== Google Fonts - Inter + Cairo (Arabic) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    --my-primary: #2563EB;
    --my-primary-hover: #1d4ed8;
    --my-primary-light: #eff6ff;
    --my-primary-100: #dbeafe;
    --my-primary-200: #bfdbfe;
    --my-primary-dark: #1e40af;
    --my-hero-bg: #f8fafc;
    --my-text-dark: #111827;
    --my-text-muted: #6b7280;
    --my-card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --my-card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --my-card-shadow-3d: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --my-border-radius: 12px;
    --my-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Override Bootstrap primary ===== */
body {
    --primary: var(--my-primary);
    --primary-100: var(--my-primary-light);
    --primary-200: var(--my-primary-200);
    --primary-300: var(--my-primary-light);
}

body, html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Arabic font support */
[lang="ar"], [dir="rtl"], .ar {
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== HERO SECTION ===== */
.hero-section,
.index-header,
.page-header {
    background: var(--my-hero-bg) !important;
    background-image: none !important;
}

.hero-section h1,
.hero-section h2,
.index-header h1,
.index-header h2,
.page-header h1,
.page-header h2 {
    color: var(--my-text-dark) !important;
    text-shadow: none !important;
}

.hero-section p,
.index-header p,
.page-header p {
    color: var(--my-text-muted) !important;
}

/* ===== CARD ===== */
.card {
    border: 1px solid #f3f4f6;
    border-radius: var(--my-border-radius);
    box-shadow: var(--my-card-shadow);
    transition: all 0.3s var(--my-transition);
}

.card:hover {
    box-shadow: var(--my-card-shadow-hover);
    transform: translateY(-2px);
    border-color: #e5e7eb;
}

/* ===== 3D Card Effects ===== */
.tool-card,
.category-card {
    transition: all 0.4s var(--my-transition);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tool-card:hover,
.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--my-card-shadow-3d);
}

/* ===== Button Styles ===== */
.btn-primary {
    background: var(--my-primary) !important;
    border-color: var(--my-primary) !important;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s var(--my-transition);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--my-primary-hover) !important;
    border-color: var(--my-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Shimmer effect on buttons */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

/* ===== Navbar ===== */
.navbar-main {
    position: relative;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.navbar-main .nav-link {
    color: var(--my-text-dark) !important;
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-main .nav-link:hover {
    color: var(--my-primary) !important;
}

.navbar-main .dropdown-menu {
    z-index: 1051;
    margin-top: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--my-border-radius);
    box-shadow: var(--my-card-shadow-3d);
    background: #fff !important;
}

.navbar-main .dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: background-color 0.15s;
}

.navbar-main .dropdown-item:hover {
    background-color: var(--my-primary-light) !important;
    color: var(--my-primary) !important;
}

[data-theme-style="dark"] .navbar-main {
    background: rgba(17, 24, 39, 0.95) !important;
    border-bottom-color: #374151;
}

[data-theme-style="dark"] .navbar-main .nav-link {
    color: #f9fafb !important;
}

[data-theme-style="dark"] .navbar-main .nav-link:hover {
    color: var(--my-primary) !important;
}

[data-theme-style="dark"] .navbar-main .dropdown-menu {
    background: #1f2937 !important;
    border-color: #374151;
}

[data-theme-style="dark"] .navbar-main .dropdown-item {
    color: #f9fafb !important;
}

[data-theme-style="dark"] .navbar-main .dropdown-item:hover {
    background-color: rgba(37, 99, 235, 0.2) !important;
    color: var(--my-primary) !important;
}

/* ===== Footer ===== */
.app-footer {
    margin: 3rem 0;
    padding: 1.25rem;
    border: 1px solid #f3f4f6;
    border-radius: var(--my-border-radius);
    background: #fafafa;
    font-size: .95rem;
}

[data-theme-style="dark"] .app-footer {
    background: #1f2937;
    border-color: #374151;
}

/* ===== Tool Result Area ===== */
.tool-result,
.result-area {
    border-radius: var(--my-border-radius);
    border: 2px solid #f3f4f6;
    background: #fafbfc;
}

/* ===== Form Controls ===== */
.form-control,
.input-group-text {
    border-radius: 8px;
    border-color: #e5e7eb;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--my-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse3d {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s var(--my-transition) forwards;
}

/* Staggered animation for grid items */
.tool-grid .col,
.category-grid .col {
    opacity: 0;
    animation: fadeInUp 0.5s var(--my-transition) forwards;
}

.tool-grid .col:nth-child(1) { animation-delay: 0.05s; }
.tool-grid .col:nth-child(2) { animation-delay: 0.1s; }
.tool-grid .col:nth-child(3) { animation-delay: 0.15s; }
.tool-grid .col:nth-child(4) { animation-delay: 0.2s; }
.tool-grid .col:nth-child(5) { animation-delay: 0.25s; }
.tool-grid .col:nth-child(6) { animation-delay: 0.3s; }
.tool-grid .col:nth-child(7) { animation-delay: 0.35s; }
.tool-grid .col:nth-child(8) { animation-delay: 0.4s; }

.category-grid .col:nth-child(1) { animation-delay: 0.05s; }
.category-grid .col:nth-child(2) { animation-delay: 0.1s; }
.category-grid .col:nth-child(3) { animation-delay: 0.15s; }
.category-grid .col:nth-child(4) { animation-delay: 0.2s; }
.category-grid .col:nth-child(5) { animation-delay: 0.25s; }
.category-grid .col:nth-child(6) { animation-delay: 0.3s; }

/* ===== Dark Mode Overrides ===== */
[data-theme-style="dark"] body {
    --my-hero-bg: #111827;
    --my-text-dark: #f9fafb;
    --my-text-muted: #9ca3af;
}

[data-theme-style="dark"] .card {
    background: #1f2937;
    border-color: #374151;
}

[data-theme-style="dark"] .hero-section,
[data-theme-style="dark"] .index-header {
    background: #111827 !important;
}

[data-theme-style="dark"] .hero-section h1,
[data-theme-style="dark"] .index-header h1 {
    color: #f9fafb !important;
}

[data-theme-style="dark"] .hero-section p,
[data-theme-style="dark"] .index-header p {
    color: #9ca3af !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .hero-section h1,
    .index-header h1 {
        font-size: 1.75rem;
    }

    .tool-card:hover,
    .category-card:hover {
        transform: translateY(-4px);
    }
}