/* SmartConvert Global Styles */
:root {
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --secondary-color: #10b981;
    /* Emerald 500 */
    --background-color: #f9fafb;
    /* Gray 50 */
    --surface-color: #ffffff;
    --text-primary: #111827;
    /* Gray 900 */
    --text-secondary: #6b7280;
    /* Gray 500 */
    --border-color: #e5e7eb;
    /* Gray 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-speed: 0.2s;
}

[data-theme="dark"] {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #818cf8;
    /* Indigo 400 */
    --secondary-color: #34d399;
    /* Emerald 400 */
    --background-color: #111827;
    /* Gray 900 */
    --surface-color: #1f2937;
    /* Gray 800 */
    --text-primary: #f9fafb;
    /* Gray 50 */
    --text-secondary: #9ca3af;
    /* Gray 400 */
    --border-color: #374151;
    /* Gray 700 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Header */
header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: #4f46e5;
    color: white;
    padding: 3rem 0;
    /* Reduced padding slightly */
    text-align: left;
    /* Align text to left for split layout */
    overflow: hidden;
    /* Prevent image overflow */
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-content {
    max-width: 600px;
    flex: 1;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-image img {
        max-height: 300px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Components */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-speed);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    background: #eef2ff;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

/* Calculator Specifics */
.calculator-wrapper {
    max-width: 600px;
    margin: 2rem auto;
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-speed);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group {
    position: relative;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f0fdf4;
    /* Green 50 */
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    display: none;
    /* Hidden by default */
    animation: fadeIn 0.3s ease-out;
}

.result-box.visible {
    display: block;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-label {
    color: #166534;
    /* Green 800 */
    font-weight: 500;
}

.result-value {
    color: #15803d;
    /* Green 700 */
    font-weight: 700;
    font-size: 1.25rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AdSense Placeholders */
.ad-slot {
    background-color: #f3f4f6;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    margin: 2rem 0;
    padding: 1rem;
    border-radius: var(--radius-md);
    min-height: 100px;
    font-size: 0.875rem;
}

.ad-slot.banner {
    min-height: 250px;
}

/* Footer */
footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Language Switcher */
.lang-switcher {
    position: relative;
    margin-left: 1rem;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
}

.lang-btn:hover {
    background-color: var(--border-color);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    min-width: 120px;
    z-index: 1000;
    overflow: hidden;
}

.lang-dropdown.show {
    display: flex;
}

.lang-option {
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.lang-option:hover {
    background-color: var(--background-color);
}

/* RTL Support via [dir="rtl"] */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .nav-links {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .lang-switcher {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .logo svg {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .card-icon {
    margin-right: 0;
    margin-left: auto;
}

/* Specific overrides for flex containers in RTL */
[dir="rtl"] .grid-2,
[dir="rtl"] .grid-3,
[dir="rtl"] .grid-4 {
    /* Grid automatically handles RTL */
}

/* Responsive */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 2.25rem;
    }

    /* Hamburger Menu */
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    /* Mobile Nav State */
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--surface-color);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        padding: 1rem 1.5rem;
        display: block;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* Mobile Grid Override */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Adjust tools wrapper on mobile */
    .calculator-wrapper {
        padding: 1.5rem 1rem;
    }

    /* Reposition Theme/Lang Toggles for Mobile */
    .nav-links .theme-toggle,
    .nav-links .lang-switcher {
        margin: 0.5rem 1.5rem;
        align-self: flex-start;
    }
}

/* Hide Hamburger on Desktop */
.mobile-menu-btn {
    display: none;
}