/**
 * Layout Styles - Header, Hero, Grid, Containers & Footer (Dark/Light & RTL)
 * App Price Calculator by starCode
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark light;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-deep);
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(139, 92, 246, 0.16) 0%, transparent 40%),
        radial-gradient(circle at 85% 25%, rgba(192, 132, 252, 0.12) 0%, transparent 35%),
        radial-gradient(circle at 50% 85%, rgba(124, 58, 237, 0.14) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-base), color var(--transition-base);
}

[data-theme="light"] body {
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(124, 58, 237, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 25%, rgba(168, 85, 247, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 85%, rgba(147, 51, 234, 0.05) 0%, transparent 50%);
}

/* Language Specific Typography */
html,
body {
    font-family: 'Inter', sans-serif;
}

[lang="en"],
[lang="en"] body,
[lang="en"] input,
[lang="en"] button,
[lang="en"] select,
[lang="en"] textarea,
[lang="en"] .card-title,
[lang="en"] .hero-title,
[lang="en"] .total-amount,
[lang="en"] .badge-rate-info {
    font-family: 'Inter', sans-serif !important;
}

[lang="ar"],
[lang="ar"] body,
[lang="ar"] input,
[lang="ar"] button,
[lang="ar"] select,
[lang="ar"] textarea,
[lang="ar"] .card-title,
[lang="ar"] .hero-title,
[lang="ar"] .total-amount,
[lang="ar"] .badge-rate-info {
    font-family: 'Tajawal', sans-serif !important;
}

[lang="ja"],
[lang="ja"] body,
[lang="ja"] input,
[lang="ja"] button,
[lang="ja"] select,
[lang="ja"] textarea,
[lang="ja"] .card-title,
[lang="ja"] .hero-title,
[lang="ja"] .total-amount,
[lang="ja"] .badge-rate-info {
    font-family: 'Noto Sans JP', sans-serif !important;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    background: var(--color-bg-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-base);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 16px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-violet-purple);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px var(--color-primary-glow);
    color: #ffffff;
    font-weight: 700;
    font-size: 19px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 11px;
    color: var(--color-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Controls Group (Currency + Language + Theme) */
.controls-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-full);
    color: var(--color-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-base);
}

.theme-toggle-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-surface-elevated);
    box-shadow: 0 0 12px var(--color-primary-glow);
    transform: rotate(15deg);
}

/* Language Selector */
.lang-selector-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-select-field {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 30px 6px 14px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a855f7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 13px;
    transition: var(--transition-fast);
}

[dir="rtl"] .lang-select-field {
    padding: 6px 14px 6px 30px;
    background-position: left 10px center;
}

.lang-select-field:hover,
.lang-select-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}

.lang-select-field option {
    background-color: var(--color-bg-surface);
    color: var(--text-primary);
}

/* Hero Section */
.hero-section {
    padding: 50px 0 28px 0;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-violet-bright);
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a855f7;
    box-shadow: 0 0 8px #c084fc;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.hero-title span {
    background: var(--gradient-violet-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    max-width: 680px;
    margin: 0 auto;
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Mode Selection Buttons */
.mode-selection-area {
    margin: 34px 0 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mode-buttons-container {
    display: inline-flex;
    background: var(--color-bg-surface);
    padding: 6px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-subtle);
    box-shadow: var(--shadow-md);
    gap: 8px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding-bottom: 60px;
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 32px;
    align-items: start;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (max-width: 960px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.site-footer {
    margin-top: auto;
    background: var(--color-bg-surface-glass);
    border-top: 1px solid var(--color-border-subtle);
    padding: 28px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    color: var(--text-secondary);
}

.footer-love {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.love-emoji {
    color: #ef4444;
    display: inline-block;
    animation: heartBeat 1.8s infinite ease-in-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
}

.footer-author {
    color: var(--text-primary);
    font-weight: 700;
}

.footer-link {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-note {
    font-size: 12px;
    color: var(--text-muted);
}
