/* KAU Theme Variables */
:root {
    /* Primary Colors */
    --primary-01: #055934;
    --primary-02: #208D44;
    --primary-03: #86C242;
    --primary-04: #D3E6BE;
    --primary-05: #F2F7ED;

    /* Secondary Colors */
    --secondary-01: #0A353E;
    --secondary-02: #2BB673;
    --secondary-03: #A7E0C5;
    --secondary-04: #EEF8F5;

    /* Neutral Colors */
    --neutral-01: #1D2921;
    --neutral-02: #5C6660;
    --neutral-03: #8D9991;
    --neutral-04: #C2CCC6;
}

/* Font Faces */
@font-face {
    font-family: 'The Year of The Camel';
    src: url('TheYearofTheCamel-ExtraBold.otf') format('opentype');
    font-weight: 800;
}
@font-face {
    font-family: 'The Year of The Camel';
    src: url('TheYearofTheCamel-Bold.otf') format('opentype');
    font-weight: 700;
}
@font-face {
    font-family: 'The Year of The Camel';
    src: url('TheYearofTheCamel-Medium.otf') format('opentype');
    font-weight: 500;
}
@font-face {
    font-family: 'The Year of The Camel';
    src: url('TheYearofTheCamel-Regular.otf') format('opentype');
    font-weight: 400;
}
@font-face {
    font-family: 'The Year of The Camel';
    src: url('TheYearofTheCamel-Light.otf') format('opentype');
    font-weight: 300;
}
@font-face {
    font-family: 'The Year of The Camel';
    src: url('TheYearofTheCamel-ExtraLight.otf') format('opentype');
    font-weight: 200;
}
@font-face {
    font-family: 'The Year of The Camel';
    src: url('TheYearofTheCamel-Thin.otf') format('opentype');
    font-weight: 100;
}

@font-face {
    font-family: 'Alexandria';
    src: url('Alexandria-semi-bold.ttf') format('truetype');
    font-weight: 600;
}
/* Fallback for other Alexandria weights using Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@300;400;500;700;800&display=swap');

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

body {
    font-family: 'Alexandria', sans-serif;
    background-color: var(--neutral-04);
    color: var(--neutral-01);
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* =====================================================
   LEFT PANEL: Controls
   ===================================================== */
.controls-panel {
    width: 420px;
    min-width: 420px;
    background-color: white;
    padding: 2rem;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.controls-panel h1 {
    font-family: 'The Year of The Camel', sans-serif;
    color: var(--primary-01);
    margin-bottom: 1.5rem;
    font-size: 22px;
}

/* Section Headers */
.section-header {
    font-family: 'Alexandria', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-01);
    background-color: var(--primary-05);
    border-right: 3px solid var(--primary-02);
    padding: 0.5rem 0.75rem;
    margin: 1.5rem 0 1rem;
    border-radius: 0 4px 4px 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--neutral-02);
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--neutral-03);
    border-radius: 4px;
    font-family: 'Alexandria', sans-serif;
    font-size: 14px;
    color: var(--neutral-01);
    background-color: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-02);
    box-shadow: 0 0 0 2px var(--primary-04);
    background-color: white;
}

/* File input */
.file-input {
    font-size: 13px !important;
    padding: 0.5rem !important;
    cursor: pointer;
}

/* Logos preview in control panel */
.logos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.logos-preview img {
    height: 40px;
    width: auto;
    object-fit: contain;
    border: 1px solid var(--neutral-04);
    border-radius: 4px;
    padding: 4px;
    background: white;
}
.logos-preview .logo-preview-item {
    position: relative;
}
.logos-preview .remove-logo-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e53e3e;
    color: white;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Add button */
.add-btn {
    width: 100%;
    padding: 0.6rem;
    background-color: transparent;
    color: var(--primary-02);
    border: 1.5px dashed var(--primary-03);
    border-radius: 4px;
    font-family: 'Alexandria', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    margin-bottom: 1rem;
}
.add-btn:hover {
    background-color: var(--primary-05);
    border-color: var(--primary-02);
}

/* Speaker entry card in controls */
.speaker-entry {
    background: var(--primary-05);
    border: 1px solid var(--primary-04);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}
.speaker-entry .remove-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
}
.speaker-entry .form-group {
    margin-bottom: 0.5rem;
}
.speaker-entry label {
    font-size: 12px;
}
.speaker-entry input {
    font-size: 13px;
    padding: 0.4rem 0.6rem;
}
.speaker-photo-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0.5rem auto;
    border: 2px solid var(--primary-03);
}

/* List item entry in controls */
.list-item-entry {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 0.5rem;
}
.list-item-entry input {
    flex: 1;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--neutral-03);
    border-radius: 4px;
    font-family: 'Alexandria', sans-serif;
    font-size: 13px;
}
.list-item-entry input:focus {
    outline: none;
    border-color: var(--primary-02);
}
.list-item-entry .remove-btn {
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Save / Load button group */
.save-load-group {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Secondary action button (Save / Load) */
.secondary-btn {
    flex: 1;
    padding: 0.7rem 0.5rem;
    background-color: white;
    color: var(--primary-01);
    border: 1.5px solid var(--primary-02);
    border-radius: 4px;
    font-family: 'Alexandria', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
}
.secondary-btn:hover {
    background-color: var(--primary-05);
    border-color: var(--primary-01);
}

/* Primary export button */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-01);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'Alexandria', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}
.primary-btn:hover {
    background-color: var(--primary-02);
}
.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =====================================================
   RIGHT PANEL: Preview
   ===================================================== */
.preview-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--neutral-04);
    padding: 2rem;
    overflow: auto;
}

.preview-wrapper {
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
}

/* =====================================================
   POSTER CANVAS (1080 x 1350)
   ===================================================== */
.poster {
    width: 1080px;
    height: 1350px;
    background-color: var(--primary-05);
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(134, 194, 66, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(5, 89, 52, 0.10) 0%, transparent 55%);
    position: relative;
    overflow: visible; /* allow box-shadow / filter effects on children to paint outside bounds */
    display: flex;
    flex-direction: column;
}

/* Background Pattern (inactive — kept for future use) */
.bg-pattern {
    display: none;
}

/* Poster Header — default: left-aligned solo IEC-KAU logo */
.poster-header {
    padding: 70px 80px 40px;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Poster Header — when partner logos are present: centered row */
.poster-header.has-partners {
    padding: 50px 80px 30px;
    justify-content: center;
}

/* =====================================================
   POSTER CONTENT
   ===================================================== */
.poster-content {
    flex: 1;
    padding: 0 80px 48px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    min-height: 0;
    overflow: hidden;
}

/* Pre-title */
.pretitle {
    font-family: 'Alexandria', sans-serif;
    font-weight: 400;
    font-size: 28px;
    line-height: 1.5;
    color: var(--neutral-02);
    margin-bottom: 8px;
}

/* Main Title */
.main-title {
    font-family: 'The Year of The Camel', sans-serif;
    font-weight: 800;
    font-size: 80px;
    line-height: 1.1;
    color: var(--primary-01);
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(5, 89, 52, 0.20);
}

/* Tighter gap in speaker layout */
.layout-speaker .main-title {
    margin-bottom: 4px;
}
.main-title.long {
    font-weight: 700;
    font-size: 56px;
    line-height: 1.2;
}
.main-title.very-long {
    font-weight: 700;
    font-size: 44px;
    line-height: 1.25;
}

/* Subtitle */
.subtitle {
    font-family: 'Alexandria', sans-serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 1.4;
    color: var(--neutral-01);
    max-width: 880px;
    margin-bottom: 16px;
}
.subtitle:empty {
    display: none;
}

/* =====================================================
   SPEAKER(S) SECTION
   ===================================================== */
.poster-speakers {
    margin-top: 24px;
}

/* Single speaker (speaker layout) */
.layout-speaker .poster-speakers {
    display: flex !important;
    align-items: center;
    gap: 40px;
    margin-top: 16px;
}

/* Single speaker card */
.speaker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}
.speaker-photo {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 6px solid var(--primary-03);
    background-color: var(--primary-04);
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(5, 89, 52, 0.28);
}
.speaker-photo-placeholder {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background-color: var(--primary-04);
    border: 6px solid var(--primary-03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}
.speaker-name {
    font-family: 'The Year of The Camel', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.2;
    color: var(--primary-01);
}
.speaker-title {
    font-family: 'Alexandria', sans-serif;
    font-weight: 400;
    font-size: 22px;
    line-height: 1.4;
    color: var(--neutral-02);
    max-width: 400px;
}

/* Multi-speaker layout: row of smaller cards */
.layout-multi-speaker .poster-speakers {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
    margin-top: 24px;
}
.layout-multi-speaker .speaker-card {
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}
.layout-multi-speaker .speaker-photo,
.layout-multi-speaker .speaker-photo-placeholder {
    width: 150px;
    height: 150px;
    min-width: 150px;
    min-height: 150px;
    border-width: 4px;
}
.layout-multi-speaker .speaker-name {
    font-size: 26px;
}
.layout-multi-speaker .speaker-title {
    font-size: 18px;
}

/* Speaker layout: put photo to side */
.layout-speaker .speaker-card {
    gap: 16px;
}

/* =====================================================
   CONTENT LIST SECTION
   ===================================================== */
.poster-list-section {
    margin-top: 20px;
    background: rgba(5, 89, 52, 0.06);
    border-radius: 16px;
    padding: 24px 32px;
    overflow: hidden;
    flex-shrink: 1;
    min-height: 0;
    box-shadow: 0 3px 8px rgba(5, 89, 52, 0.18);
}

.list-heading {
    font-family: 'Alexandria', sans-serif;
    font-weight: 700;
    font-size: 30px;
    color: var(--primary-01);
    margin-bottom: 20px;
}

.list-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Two-column grid when more than 2 items */
.list-items.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 36px;
}

.list-items li {
    font-family: 'Alexandria', sans-serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.5;
    color: var(--neutral-01);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.list-items li::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-03);
    flex-shrink: 0;
    margin-top: 8px;
}

/* =====================================================
   POSTER FOOTER
   ===================================================== */
.poster-footer {
    z-index: 1;
    flex-shrink: 0;
    padding: 0 60px 24px;
    background: transparent;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
}

/* Partner logos strip — lives inside .poster-header */
.partner-logos-strip {
    display: flex;
    flex-wrap: nowrap;          /* keep all logos on a single line */
    align-items: center;
    gap: 36px;
}

/* When partners exist, stretch strip and center contents */
.poster-header.has-partners .partner-logos-strip {
    justify-content: center;
    width: 100%;
}

/* IEC-KAU logo wrapper — display inline-flex so it aligns with partner logos */
.partner-logos-strip .iec-kau-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* IEC-KAU logo — solo mode (no partners): original size */
.partner-logos-strip .iec-kau-logo {
    height: 160px;
    width: auto;
    object-fit: contain;
}

/* IEC-KAU logo — when partners are present: slightly reduced to harmonize */
.poster-header.has-partners .partner-logos-strip .iec-kau-logo {
    height: 135px;
}

/* Uploaded partner logos */
.partner-logos-strip .partner-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    max-width: 240px;
    flex-shrink: 0;
}
.partner-logos-strip .partner-logo-wrapper img {
    max-height: 100px;
    max-width: 240px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Vertical divider between logos */
.logo-divider {
    width: 2px;
    height: 80px;
    background-color: var(--primary-03);
    border-radius: 2px;
    flex-shrink: 0;
    opacity: 0.6;
}

/* Footer unified panel — KAU dark green */
.footer-top-row {
    flex: 1;
    background: var(--primary-01);
    border-radius: 20px;
    padding: 22px 28px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -3px 8px rgba(5, 89, 52, 0.28), 0 5px 10px rgba(0, 0, 0, 0.22);
}

/* Details area: flex-wrap so dynamic show/hide always centers items */
.details {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 16px;
    align-items: center;
    align-content: center;
    justify-content: center;
}

/* Each detail item: icon above, text below */
.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    font-family: 'Alexandria', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--primary-04);
    background: transparent;
    padding: 0;
    box-shadow: none;
    min-width: 140px;
    max-width: 180px;
    flex: 1 1 140px;
}

/* SVG icon */
.detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: transparent;
    color: var(--primary-04);
    flex-shrink: 0;
}

.detail-icon svg {
    width: 56px;
    height: 56px;
    stroke: var(--primary-04);
    stroke-width: 1.5;
}

/* Badge variant — transparent on dark green */
.detail-badge {
    background: transparent;
    border: none;
}

.detail-badge .detail-icon {
    background: transparent;
}

/* Special date block: stacked day-of-week / number / month */
.detail-date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: var(--primary-02);
    border-radius: 12px;
    padding: 8px 16px;
    min-width: 80px;
    color: white;
}

.date-day-name {
    font-family: 'Alexandria', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-04);
    letter-spacing: 0.03em;
}

.date-day-number {
    font-family: 'The Year of The Camel', sans-serif;
    font-weight: 800;
    font-size: 38px;
    line-height: 1;
    color: #ffffff;
}

.date-month {
    font-family: 'Alexandria', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-04);
}

/* =====================================================
   CONTROLS PANEL: Checkbox styling
   ===================================================== */
.checkbox-group {
    margin-bottom: 0.75rem;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--neutral-02);
    font-size: 13px;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-02);
    cursor: pointer;
    flex-shrink: 0;
}

/* QR Code Wrapper — sits beside the footer panel on the same line */
.qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--primary-04);
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 240px;
    flex-shrink: 0;
    box-shadow: 0 3px 6px rgba(5, 89, 52, 0.20);
}

/* QR Code Box */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

#qrcode {
    width: 200px;
    height: 200px;
    min-width: 200px;
    min-height: 200px;
    flex-shrink: 0;
}

/* Allow JS to override size for complex QR codes */
#qrcode img,
#qrcode canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* URL text inside QR box */
.qr-url-text {
    font-family: 'Alexandria', sans-serif;
    font-weight: 400;
    font-size: 10px;
    color: var(--neutral-02);
    text-align: center;
    word-break: break-all;
    max-width: 120px;
    line-height: 1.3;
    direction: ltr;
}

.qr-label {
    font-family: 'Alexandria', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-01);
}

/* Disclaimer text inside QR wrapper (shown for simple URLs) */
.qr-inline-disclaimer {
    font-family: 'Alexandria', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: var(--neutral-02);
    text-align: center;
    max-width: 200px;
    line-height: 1.5;
    direction: rtl;
}

/* Disclaimer text below the footer (shown for complex URLs) */
.poster-disclaimer {
    font-family: 'Alexandria', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: var(--neutral-03);
    text-align: center;
    width: 100%;
    padding: 0 60px 20px;
    line-height: 1.4;
    direction: rtl;
    z-index: 1;
}

/* =====================================================
   LANGUAGE SPECIFIC LAYOUTS
   ===================================================== */
.poster.ar {
    direction: rtl;
}
.poster.ar .poster-header {
    justify-content: flex-start;
}
.poster.ar .poster-header.has-partners {
    justify-content: center;
}
.poster.ar .section-header {
    border-right: 3px solid var(--primary-02);
    border-left: none;
}

/* In Arabic (RTL) mode, place QR wrapper on the left side */
.poster.ar .poster-footer .qr-wrapper {
    order: 1;
}
.poster.ar .poster-footer .footer-top-row {
    order: -1;
}

.poster.en {
    direction: ltr;
}
.poster.en .poster-header {
    justify-content: flex-start;
}
.poster.en .poster-header.has-partners {
    justify-content: center;
}
.poster.en .section-header {
    border-left: 3px solid var(--primary-02);
    border-right: none;
}

/* =====================================================
   LAYOUT VARIATIONS
   ===================================================== */

/* Standard: content block centered vertically */
.layout-standard .poster-content {
    justify-content: center;
}

/* Speaker layout: title spans full width, then speaker photo + content in row below */
.layout-speaker .poster-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

/* Text block: stacks pretitle + title above the side-by-side area */
.layout-speaker .poster-text-block {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Side row: speaker photo on one side, subtitle/list on the other */
.layout-speaker .poster-speaker-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    margin-top: 20px;
}

.layout-speaker .poster-speakers {
    flex-shrink: 0;
    width: 260px;
    margin-top: 0;
}

/* List: vertically centered, with a little extra top breathing room */
.layout-list .poster-content {
    justify-content: center;
    padding-top: 20px;
}
.layout-list .main-title {
    font-size: 60px;
}

/* Multi-speaker: compact title, vertically centered row of photos */
.layout-multi-speaker .poster-content {
    justify-content: center;
    padding-top: 10px;
}
.layout-multi-speaker .main-title {
    font-size: 60px;
    margin-bottom: 16px;
}

/* =====================================================
   CONTROLS PANEL SIDEBAR SECTION HEADER (RTL fix)
   ===================================================== */
.controls-panel .section-header {
    border-right: 3px solid var(--primary-02);
    border-left: none;
}

/* =====================================================
   SQUARE FORMAT OVERRIDES (1080×1080 — X.com / Twitter)
   All rules scoped to .poster.format-square so the
   existing portrait format is completely unaffected.
   ===================================================== */

/* Canvas size */
.poster.format-square {
    height: 1080px;
}

/* Header — less vertical padding */
.poster.format-square .poster-header {
    padding: 44px 64px 26px;
}
.poster.format-square .poster-header.has-partners {
    padding: 32px 64px 20px;
}

/* Content area — less vertical padding */
.poster.format-square .poster-content {
    padding: 0 64px 24px;
}

/* Pre-title */
.poster.format-square .pretitle {
    font-size: 22px;
    margin-bottom: 6px;
}

/* Main title */
.poster.format-square .main-title {
    font-size: 64px;
}
.poster.format-square .main-title.long {
    font-size: 44px;
}
.poster.format-square .main-title.very-long {
    font-size: 36px;
}

/* Subtitle */
.poster.format-square .subtitle {
    font-size: 24px;
    margin-bottom: 12px;
}

/* Logos */
.poster.format-square .partner-logos-strip .iec-kau-logo {
    height: 120px;
}
.poster.format-square .poster-header.has-partners .partner-logos-strip .iec-kau-logo {
    height: 100px;
}
.poster.format-square .partner-logos-strip .partner-logo-wrapper {
    height: 75px;
    max-width: 180px;
}
.poster.format-square .partner-logos-strip .partner-logo-wrapper img {
    max-height: 75px;
    max-width: 180px;
}
.poster.format-square .logo-divider {
    height: 65px;
}

/* Speaker photos */
.poster.format-square .speaker-photo,
.poster.format-square .speaker-photo-placeholder {
    width: 170px;
    height: 170px;
    min-width: 170px;
    min-height: 170px;
    border-width: 4px;
}
.poster.format-square .speaker-name {
    font-size: 28px;
}
.poster.format-square .speaker-title {
    font-size: 17px;
}

/* Multi-speaker layout */
.poster.format-square .layout-multi-speaker .speaker-photo,
.poster.format-square .layout-multi-speaker .speaker-photo-placeholder {
    width: 120px;
    height: 120px;
}
.poster.format-square .layout-multi-speaker .speaker-name {
    font-size: 20px;
}
.poster.format-square .layout-multi-speaker .speaker-title {
    font-size: 14px;
}

/* Content list */
.poster.format-square .poster-list-section {
    padding: 16px 24px;
    margin-top: 14px;
}
.poster.format-square .list-heading {
    font-size: 22px;
    margin-bottom: 14px;
}
.poster.format-square .list-items li {
    font-size: 18px;
}
.poster.format-square .list-items {
    gap: 10px;
}
.poster.format-square .list-items.two-col {
    gap: 10px 28px;
}

/* Footer */
.poster.format-square .poster-footer {
    padding: 0 48px 16px;
    gap: 12px;
}
.poster.format-square .footer-top-row {
    padding: 14px 20px;
    border-radius: 16px;
}
.poster.format-square .details {
    gap: 10px 12px;
}
.poster.format-square .detail-item {
    font-size: 17px;
    gap: 6px;
    min-width: 110px;
    max-width: 140px;
    flex: 1 1 110px;
}
.poster.format-square .detail-icon {
    width: 50px;
    height: 50px;
}
.poster.format-square .detail-icon svg {
    width: 42px;
    height: 42px;
}
.poster.format-square .detail-date-block {
    padding: 6px 12px;
    border-radius: 10px;
}
.poster.format-square .date-day-name {
    font-size: 11px;
}
.poster.format-square .date-day-number {
    font-size: 28px;
}
.poster.format-square .date-month {
    font-size: 11px;
}

/* QR code */
.poster.format-square .qr-wrapper {
    min-width: 190px;
    padding: 12px 14px;
    gap: 8px;
    border-radius: 12px;
}
.poster.format-square #qrcode {
    width: 160px;
    height: 160px;
    min-width: 160px;
    min-height: 160px;
}
.poster.format-square .qr-label {
    font-size: 12px;
}
.poster.format-square .qr-url-text {
    font-size: 9px;
}
.poster.format-square .qr-inline-disclaimer {
    font-size: 11px;
    max-width: 160px;
}
.poster.format-square .poster-disclaimer {
    padding: 0 48px 14px;
    font-size: 11px;
}

/* =====================================================
   DESIGN MODE — Drag & Resize
   ===================================================== */

/* Design mode group in controls panel */
.design-mode-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.design-mode-toggle.active {
    background-color: var(--primary-01);
    color: white;
    border-color: var(--primary-01);
}

.reset-layout-btn {
    color: #c05000 !important;
    border-color: #c05000 !important;
}
.reset-layout-btn:hover {
    background-color: #fff5ee !important;
}

.design-mode-hint {
    font-size: 12px;
    color: var(--neutral-02);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    padding: 8px 10px;
    background: var(--primary-05);
    border-radius: 6px;
    border-right: 3px solid var(--primary-03);
}

/* Poster in design mode — cursor indicates interactive */
.poster.design-mode {
    cursor: default;
}

/* Any draggable element on the poster */
.poster.design-mode [data-editable] {
    position: relative;
    cursor: grab;
    outline: 2px dashed transparent;
    outline-offset: 4px;
    transition: outline-color 0.15s;
    user-select: none;
    overflow: visible !important;  /* allow resize handle & badge to overflow */
}

.poster.design-mode [data-editable]:hover {
    outline-color: var(--primary-03);
}

/* Selected element */
.poster.design-mode [data-editable].selected {
    outline: 2px solid var(--primary-02);
    outline-offset: 4px;
    cursor: grab;
    z-index: 100;
}

/* While actually dragging */
.poster.design-mode [data-editable].dragging {
    cursor: grabbing;
    outline-color: var(--primary-01);
    opacity: 0.85;
}

/* Resize handle — corner dot */
.resize-handle {
    display: none;
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    background: var(--primary-01);
    border: 2px solid white;
    border-radius: 50%;
    cursor: se-resize;
    z-index: 200;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* RTL: swap handle to left corner */
.poster.ar .resize-handle {
    right: auto;
    left: -6px;
    cursor: sw-resize;
}

/* Show handle only when element is selected */
.poster.design-mode [data-editable].selected .resize-handle {
    display: block;
}

/* Font-size control badge (appears above selected text elements) */
.font-size-badge {
    display: none;
    position: absolute;
    top: -30px;
    right: 0;
    background: var(--primary-01);
    color: white;
    font-size: 11px;
    font-family: 'Alexandria', monospace;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 300;
}
.poster.ar .font-size-badge {
    right: auto;
    left: 0;
}

.poster.design-mode [data-editable].selected .font-size-badge {
    display: block;
}

/* =====================================================
   IMAGE CROP MODAL
   ===================================================== */

/* Fullscreen overlay */
.crop-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Alexandria', sans-serif;
    direction: ltr; /* Cropper.js controls look best LTR */
}

/* Semi-transparent dark backdrop */
.crop-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 30, 18, 0.80);
    backdrop-filter: blur(4px);
}

/* Dialog box */
.crop-modal-dialog {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    width: min(90vw, 760px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.crop-modal-header {
    background: var(--primary-01);
    padding: 18px 24px 14px;
    flex-shrink: 0;
}

.crop-modal-header h2 {
    color: #ffffff;
    font-family: 'The Year of The Camel', sans-serif;
    font-weight: 700;
    font-size: 22px;
    margin: 0 0 4px;
}

.crop-modal-hint {
    color: var(--primary-04);
    font-size: 12px;
    font-weight: 400;
    margin: 0;
}

/* Body — contains the cropper canvas */
.crop-modal-body {
    flex: 1;
    overflow: hidden;
    background: #1a1a1a;
    position: relative;
}

/* The img Cropper.js is applied to */
.crop-image-container {
    width: 100%;
    height: 100%;
    max-height: calc(92vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-image-container img {
    /* Cropper.js manages display; just prevent default stretching */
    display: block;
    max-width: 100%;
}

/* Footer: action buttons */
.crop-modal-footer {
    flex-shrink: 0;
    background: var(--primary-05);
    border-top: 1px solid var(--primary-04);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Override width so the buttons inside the modal don't span 100% */
.crop-modal-footer .secondary-btn,
.crop-modal-footer .primary-btn {
    width: auto;
    flex: none;
    margin: 0;
    padding: 0.65rem 1.4rem;
    font-size: 14px;
}

/* Queue indicator — shown when multiple files are being cropped */
.crop-queue-indicator {
    flex: 1;
    font-size: 13px;
    color: var(--neutral-02);
}
