/* Base Styles */
:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --muted-color: #66727d;
    --border-color: #dfe5e9;
    --soft-bg: #f8fafb;
    --shadow: 0 10px 30px rgba(36, 54, 70, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 24px 16px;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .brand {
    flex-direction: row-reverse;
}

body.rtl .research-output-list {
    padding-left: 0;
    padding-right: 1.6rem;
}

body.rtl .header-tools {
    right: auto;
    left: 0;
}

body.rtl .output-option {
    text-align: right;
}

body.rtl .results-header {
    text-align: right;
}

.app-container {
    max-width: 940px;
    margin: 0 auto;
}

h1 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin: 0.25rem 0 0.4rem;
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.15;
}

.app-header {
    text-align: center;
    margin-bottom: 1.45rem;
    position: relative;
}

.header-tools {
    position: absolute;
    top: 0;
    right: 0;
}

.language-selector select {
    width: auto;
    min-width: 145px;
    padding: 8px 34px 8px 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0.7rem;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand-badge {
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.subtitle {
    margin: 0;
    color: #46515b;
    font-size: 1rem;
}

.powered-by {
    font-size: 0.84rem;
    color: #7a838b;
    margin-top: 0.55rem;
    margin-bottom: 0;
    font-style: italic;
}

.generator-card,
.results-card {
    background: var(--card-bg);
    padding: 2.15rem;
    border: 1px solid rgba(223, 229, 233, 0.9);
    border-radius: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #34414c;
}

textarea,
select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.98rem;
    background: white;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.12);
}

textarea {
    resize: vertical;
}

.output-options {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--soft-bg);
}

.output-options-title {
    margin-bottom: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.output-option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-top: 1rem;
}

.output-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.output-option:hover {
    border-color: var(--accent-color);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.08);
    transform: translateY(-1px);
}

.output-option:has(input:checked) {
    border-color: var(--accent-color);
    background: #f4faff;
}

.output-option input {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    flex: 0 0 auto;
    accent-color: var(--accent-color);
}

.output-option-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.output-option-copy strong {
    color: var(--primary-color);
}

.output-option-copy small {
    color: #67727c;
    font-weight: 400;
    line-height: 1.45;
}

.output-methodology-note {
    margin-bottom: 0;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.68;
    cursor: wait;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-sm {
    padding: 9px 14px;
    font-size: 0.88rem;
    width: auto;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 8px 18px rgba(52, 152, 219, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background: #f1f4f6;
    color: var(--primary-color);
}

.btn-secondary:hover:not(:disabled) {
    background: #e7edf1;
}

.results-placeholder {
    text-align: center;
    color: #777;
    padding: 2.25rem 1rem;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.9rem;
    border-radius: 18px;
    background: #f2f6f8;
    color: #7b8790;
}

.placeholder-icon svg {
    width: 38px;
    height: 38px;
    display: block;
}

.results-placeholder h3 {
    margin: 0 0 0.45rem;
    color: var(--primary-color);
    font-size: 1.05rem;
}

.results-placeholder p {
    max-width: 480px;
    margin: 0;
    color: var(--muted-color);
}

.hidden {
    display: none !important;
}

.results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.results-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2rem);
    line-height: 1.2;
}

.badge {
    flex: 0 0 auto;
    font-size: 0.78rem;
    padding: 0.38rem 0.68rem;
    border-radius: 999px;
    background: #eef5fb;
    color: var(--primary-color);
    font-weight: 600;
}

.result-block {
    padding: 1.25rem 0;
    border-top: 1px solid #edf0f2;
}

.result-block:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.result-block-title {
    margin: 0 0 0.85rem;
    color: var(--primary-color);
    font-size: 1.03rem;
}

.research-output-list {
    margin: 0;
    padding-left: 1.6rem;
}

.research-output-list li {
    margin-bottom: 0.85rem;
    padding-left: 0.2rem;
    line-height: 1.65;
}

.research-output-list li::marker {
    color: var(--accent-color);
    font-weight: 700;
}

.research-output-list li:last-child {
    margin-bottom: 0;
}

.methodology-notice {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid #d7e6f2;
    border-left: 4px solid var(--accent-color);
    border-radius: 9px;
    background: #f6fafe;
    color: #4c6275;
    font-size: 0.9rem;
}

body.rtl .methodology-notice {
    border-left: 1px solid #d7e6f2;
    border-right: 4px solid var(--accent-color);
}

.results-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #edf0f2;
}

.copy-feedback {
    color: #248a4b;
    font-size: 0.88rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-feedback.visible {
    opacity: 1;
}

.helper-text {
    font-size: 0.84rem;
    color: #6b747c;
    margin-top: 0.25rem;
}

.error-text {
    font-size: 0.84rem;
    color: #c9443e;
    margin-top: 0.25rem;
}

.app-footer {
    text-align: center;
    color: #7b858e;
    font-size: 0.84rem;
    padding: 0.5rem 0 1.25rem;
}

@media (max-width: 700px) {
    body {
        padding: 16px 10px;
    }

    .header-tools {
        position: static;
        display: flex;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .form-row,
    .output-option-grid {
        grid-template-columns: 1fr;
    }

    .generator-card,
    .results-card {
        padding: 1.2rem;
        border-radius: 12px;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .badge {
        align-self: flex-start;
    }

    body.rtl .badge {
        align-self: flex-end;
    }

    .results-placeholder {
        min-height: 220px;
        padding: 1.5rem 0.5rem;
    }

    .placeholder-icon {
        width: 68px;
        height: 68px;
    }

    .placeholder-icon svg {
        width: 36px;
        height: 36px;
    }

    .btn-sm {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .brand {
        gap: 8px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
    }

    .brand-badge {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .generator-card,
    .results-card {
        padding: 1rem;
    }

    textarea,
    select {
        font-size: 16px;
    }

    .research-output-list {
        padding-left: 1.35rem;
    }

    body.rtl .research-output-list {
        padding-right: 1.35rem;
    }
}
