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

/* Custom Romanization Font */
@font-face {
    font-family: 'RomanizationFont';
    src: url('fonts/Ro_manization.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --green-dark:   #1a5c3a;
    --green-mid:    #2e7d52;
    --green-light:  #e8f5ee;
    --green-border: #b5d9c5;
    --gold:         #c9a84c;
    --bg-page:      #f0f4f2;
    --bg-white:     #ffffff;
    --text-dark:    #1a2e22;
    --text-mid:     #3d5a47;
    --text-muted:   #6b8a76;
    --border-light: #d4e4da;
    --shadow-card:  0 2px 16px rgba(26, 92, 58, 0.09);
    --radius-card:  16px;
    --radius-btn:   10px;
}

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

body {
    font-family: 'Tajawal', 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 4rem;
    line-height: 1.7;
}

/* ── Top Bar ─────────────────────────────────────────── */
.top-bar {
    width: 100%;
    background: var(--green-dark);
    padding: 0.85rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 3px 12px rgba(26, 92, 58, 0.4);
}

.top-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
}

.top-bar-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.top-bar-icon svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.top-bar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.top-bar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.top-bar-sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    font-weight: 400;
}

/* ── Page Container ──────────────────────────────────── */
.app-container {
    width: 100%;
    max-width: 800px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow-card);
    margin: 0 1rem;
}

/* ── Header ──────────────────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--green-light);
}

.header h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--green-dark);
    margin-bottom: 0.4rem;
}

.header p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* ── Warning Note ────────────────────────────────────── */
.warning-note {
    background: #fffbeb;
    border: 1px solid #e9d080;
    color: #7a5f00;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-btn);
    margin-bottom: 1.5rem;
    font-size: 0.93rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.warning-note svg { fill: var(--gold); flex-shrink: 0; }

/* ── Input ───────────────────────────────────────────── */
.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.input-group label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--green-dark);
}

textarea {
    width: 100%;
    min-height: 110px;
    background: #fafcfb;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-btn);
    padding: 0.9rem 1rem;
    font-size: 1.25rem;
    color: var(--text-dark);
    font-family: 'Tajawal', sans-serif;
    resize: vertical;
    transition: border-color 0.25s, box-shadow 0.25s;
    direction: rtl;
}

textarea::placeholder { color: #b0c4ba; }

textarea:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 4px rgba(46, 125, 82, 0.1);
}

/* ── Result ──────────────────────────────────────────── */
.result-container {
    margin-top: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.result-container label {
    font-weight: 700;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.6rem;
    color: var(--green-dark);
}

.result-box {
    background: var(--green-light);
    border: 2px solid var(--green-border);
    border-radius: var(--radius-btn);
    padding: 1.4rem 1.8rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-text {
    font-family: 'RomanizationFont', 'Inter', sans-serif;
    font-size: 2.2rem;
    color: var(--green-dark);
    letter-spacing: 0.5px;
    direction: ltr;
    text-align: center;
    width: 100%;
}

/* ── Download Section ────────────────────────────────── */
.doc-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    padding: 1.5rem 2rem;
    margin-top: 1.5rem;
}

.doc-section h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--green-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-section h2 svg { fill: var(--green-mid); }

.doc-section p {
    color: var(--text-muted);
    font-size: 0.93rem;
    margin-bottom: 1rem;
}

/* ── Download Grid ───────────────────────────────────── */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--green-light);
    color: var(--green-dark);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border: 1px solid var(--green-border);
    border-radius: var(--radius-btn);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.btn-download:hover {
    background: var(--green-border);
    box-shadow: 0 4px 12px rgba(26, 92, 58, 0.15);
    transform: translateY(-2px);
}

.btn-download span {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    border-right: 1px solid var(--green-border);
    padding-right: 0.5rem;
}

/* ── Footer Branding ─────────────────────────────────── */
.footer-branding {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-branding strong { color: var(--green-dark); }

/* ── Animation ───────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .app-container { padding: 1.5rem 1.2rem; }
    .header h1 { font-size: 1.5rem; }
    textarea { font-size: 1.1rem; }
    .result-text { font-size: 1.75rem; }
    .top-bar { padding: 0.7rem 1rem; }
}
