/* Modern, minimalist CSS inspired by DeepChip, highly text-focused */

:root {
    --bg-color: #fdfdfd;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --link-color: #0056b3;
    --link-hover: #003d82;
    --border-color: #e0e0e0;
    --btn-primary-bg: #1a1a1a;
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #f0f0f0;
    --btn-secondary-text: #333333;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Iran Flag.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.16;
    /* Highly transparent to ensure readability */
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container-wide {
    max-width: 1200px;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.centered {
    text-align: center;
}

.vision-statement-section {
    margin-bottom: 3rem;
}

.vision-text {
    font-style: italic;
    line-height: 1.8;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Header & Nav */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 1000;
}

nav {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    margin-right: auto;
    border: none !important;
    padding: 0 !important;
}

.logo-link:hover {
    border: none !important;
    text-decoration: none !important;
}

.site-logo {
    height: 50px;
    width: auto;
    display: block;
}

.main-logo {
    display: block;
    margin: 0 auto 1.5rem auto;
    max-width: 300px;
    height: auto;
}

nav a,
.dropdown-toggle {
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

nav a.active,
.dropdown.active .dropdown-toggle {
    color: var(--text-color);
    border-bottom: 2px solid var(--text-color);
    padding-bottom: 2px;
}

nav a:hover,
.dropdown:hover .dropdown-toggle,
.dropdown.open .dropdown-toggle {
    color: var(--text-color);
    text-decoration: none;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 280px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
    border-bottom: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background-color: var(--btn-secondary-bg);
    color: var(--text-color);
}

.dropdown-toggle::after {
    content: ' \25BE';
    /* Down arrow enlarged by 50% */
    font-size: 1.2rem;
    vertical-align: middle;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    background-color: #333;
    color: var(--btn-primary-text);
}

.btn-secondary {
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.btn-secondary:hover {
    background-color: #e4e4e4;
    color: var(--btn-secondary-text);
}

/* Downloads Section */
.downloads {
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}



.primary-download {
    margin-bottom: 2rem;
}

.primary-download .btn {
    display: block;
    width: 100%;
}

.download-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.download-list li .btn {
    width: 100%;
    font-size: 0.9rem;
}

.container-wide {
    max-width: 800px;
}

/* Layout for Endorsement Page */
.endorsement-section {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .endorsement-section {
        margin-top: 1rem;
    }
}

/* Form Styles */
.form-container,
.ledger-container {
    background: #fff;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.required {
    color: #d93025;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--text-color);
}

/* Ledger List */
.ledger-desc {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.ledger-list {
    list-style: none;
    border-top: 1px solid var(--border-color);
}

.ledger-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-color);
}

.ledger-list li strong {
    font-weight: 600;
}

/* Centered Form Layout */
.form-container-centered {
    /* max-width: 100%; */
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    align-items: center;
}

.form-actions .btn {
    width: 30%;
}

.ledger-container-full {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
}

/* Utilities */
.hidden {
    display: none;
}

.message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.message.success {
    background-color: #e6f4ea;
    color: #1e8e3e;
    border: 1px solid #ceead6;
}

.message.error {
    background-color: #fce8e6;
    color: #d93025;
    border: 1px solid #f9d2ce;
}

/* PDF Preview Section */
.pdf-preview {
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    background: #eee;
    position: relative;
    overflow: hidden;
    transition: height 0.5s ease;
}

.pdf-preview.collapsed {
    height: 600px;
    /* Fixed height for "preview" mode */
}

.pdf-preview.expanded {
    height: 1000px;
    /* Taller or auto height */
}

.pdf-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(transparent, var(--bg-color));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2rem;
    pointer-events: none;
}

.pdf-preview.expanded .pdf-overlay {
    background: none;
}

/* Navigation Grid for Parts */
.parts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 3rem;
}

.part-card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.part-card:hover {
    border-color: var(--text-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.part-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.part-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    display: block;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.part-card a {
    text-decoration: none;
    color: inherit;
}

.part-card a:hover {
    text-decoration: none;
}

/* Footer & Utilities */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pointer-events-all {
    pointer-events: all;
}

/* Language Switcher Button (Top Left) */
.preview-header {
    display: flex;
    justify-content: center; /* Center the language toggle button */
    margin-bottom: 0.5rem;
}

.lang-toggle-btn {
    padding: 0.5rem 1.2rem; /* Was 0.4rem 1rem */
    font-size: 1.1rem;      /* Was 0.9rem */
    font-weight: 600;
    cursor: pointer;
    background-color: #4a4a4a; /* Space Grey */
    color: #ffffff;
    border: 1px solid #363636;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-toggle-btn:hover {
    background-color: #3a3a3a;
    text-decoration: none;
}

/* Farsi Button Variant */
.btn-farsi {
    background-color: #2e7d32; /* A premium green */
    color: #ffffff;
}

.btn-farsi:hover {
    background-color: #1b5e20;
    color: #ffffff;
}

.download-box {
    display: flex;
    justify-content: space-between; /* Push buttons to opposite edges */
    align-items: flex-start;
    gap: 1rem;
    margin-top: 2rem;
}

/* Download layout adjustments */
.download-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 0 0 auto;
    width: 380px; /* Restored previous width */
}

.download-box > .btn {
    flex: 0 0 auto; /* Only as wide as needed for the text */
    min-width: 200px; /* Ensure it still looks like a button */
}

/* Committee Page Details */
.committee-details p {
    margin-bottom: 0.25rem;
    line-height: 1.4;
    font-size: 0.8em; /* 20% reduction */
}