/* PHQ-9 App - qsairat.net Branding (matching mini-pid5 style) */
:root {
    --brand-dark: #1a2332;
    --brand-primary: #0056b3;
    --brand-primary-hover: #003d80;
    --brand-light: #f7f8fa;
    --white: #fff;
}

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

body {
    font-family: 'Cairo', 'Noto Naskh Arabic', sans-serif;
    background-color: var(--brand-light);
    min-height: 100vh;
    line-height: 1.7;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
    font-size: 15px;
}

/* ========== Brand Header ========== */
.brand-header {
    background-color: var(--brand-dark);
    color: var(--white);
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    direction: rtl;
}

.brand-header .header-text {
    text-align: center;
    flex: 1;
}

.brand-header .header-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 4px;
}

.brand-header .header-subtitle {
    font-size: 1.1em;
    color: #aacfff;
    margin-bottom: 4px;
}

.brand-header .header-credit {
    font-size: 0.95em;
    color: #bbb;
}

.brand-header img.logo {
    height: 140px;
    width: 140px;
    max-height: 140px;
    max-width: 140px;
    object-fit: contain;
    background-color: #fff;
    border-radius: 50%;
    padding: 8px;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(255,255,255,0.35);
}

/* ========== Brand Footer ========== */
.brand-footer {
    background-color: var(--brand-dark);
    color: var(--white);
    text-align: center;
    padding: 18px;
    font-size: 1.1em;
    font-weight: 600;
    margin-top: auto;
}

.brand-footer a {
    color: var(--white);
    text-decoration: none;
}

.brand-footer a:hover {
    color: #aacfff;
}

/* ========== Main Content ========== */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
    width: 100%;
}

/* ========== Card ========== */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 25px;
}

.card h1 {
    text-align: center;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 1.5em;
    margin-bottom: 16px;
}

/* ========== Instructions ========== */
.instructions {
    background-color: #e8f4fd;
    border-right: 4px solid var(--brand-primary);
    border-radius: 4px;
    padding: 15px 18px;
    margin-bottom: 22px;
    color: var(--brand-dark);
    font-size: 0.95em;
}

.instructions p {
    margin: 0;
    font-weight: 600;
    font-size: 1.1em;
}

/* ========== Table ========== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #dde2e8;
    vertical-align: top;
}

table tr td:first-child {
    font-weight: 600;
    width: 40%;
}

.additional-question {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #dde2e8;
    background-color: #fafbfc;
    border-radius: 4px;
}

/* ========== Submit Button ========== */
.submit-container {
    text-align: center;
    margin-top: 10px;
}

input[type=submit] {
    width: 100%;
    max-width: 300px;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    margin-top: 10px;
}

input[type=submit]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.3);
}

/* ========== Results ========== */
.results {
    background-color: #e8f4fd;
    border: 2px solid var(--brand-primary);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.results p {
    margin: 0;
    color: var(--brand-dark);
    font-size: 1.3em;
}

/* ========== Refresh Button ========== */
#refreshButton {
    position: fixed;
    left: 10px;
    top: 10px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    font-weight: 600;
}

#refreshButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .brand-header {
        flex-direction: column;
        gap: 15px;
    }
    .brand-header .header-title { font-size: 1.5em; }
    .main-content { padding: 20px 15px; }
    .card { padding: 20px; }
    table { font-size: 13px; }
}

@media (max-width: 480px) {
    .brand-header { padding: 16px; }
    .brand-header .header-title { font-size: 1.3em; }
    .brand-header img.logo {
        height: 100px; width: 100px;
        max-height: 100px; max-width: 100px;
    }
    .main-content { padding: 15px 10px; }
    .card { padding: 15px; }
}

/* ========== Print ========== */
@media print {
    body { background: white; }
    .brand-header, .brand-footer, #refreshButton { display: none; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
