/* ========================================
   MINIMALIST ELEGANT TEST MAKER
   ======================================== */

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

:root {
    /* Elegant Neutral Colors */
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-border: #e5e5e5;
    --color-text: #171717;
    --color-text-light: #737373;
    --color-accent: #171717;
    --color-hover: #f5f5f5;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER
   ======================================== */
.header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-header {
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-header:hover {
    background: var(--color-hover);
}

.btn-header.primary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.btn-header.primary:hover {
    opacity: 0.9;
}

.design-selector {
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 200px;
}

.design-selector:hover {
    background: var(--color-hover);
    border-color: var(--color-accent);
}

.design-selector:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ========================================
   MAIN LAYOUT
   ======================================== */
.main-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 1fr 280px;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text);
}

/* ========================================
   UPLOAD BOX
   ======================================== */
.upload-box {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-box:hover {
    border-color: var(--color-accent);
    background: var(--color-hover);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 14px;
    color: var(--color-text-light);
}

/* ========================================
   PDF VIEWER
   ======================================== */
.pdf-viewer {
    margin-top: 16px;
}

.pdf-viewer.hidden,
.hidden {
    display: none !important;
}

.pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.pdf-controls button {
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pdf-controls button:hover {
    background: var(--color-hover);
}

.pdf-controls span {
    font-size: 13px;
    color: var(--color-text-light);
}

.pdf-canvas-wrapper {
    position: relative;
    background: var(--color-hover);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    overflow: auto;
    max-height: 500px;
    display: flex;
    justify-content: center;
}

.pdf-canvas-wrapper-main {
    position: relative;
    background: var(--color-hover);
    border-radius: 8px;
    padding: 20px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100%;
}

#pdfCanvas {
    display: block;
    cursor: crosshair;
    box-shadow: var(--shadow-lg);
    background: white;
    max-width: 100%;
}

/* PDF Viewer Area */
.pdf-area {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--color-accent);
    color: white;
    border-bottom: 1px solid var(--color-border);
}

.pdf-nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pdf-nav-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

.pdf-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.pdf-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pdf-page-info {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.pdf-close-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.pdf-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#pdfViewerMain.hidden {
    display: none;
}

#pdfEmptyState {
    min-height: 600px;
}

/* Draggable Elements */
.draggable {
    cursor: move;
    user-select: none;
}

.draggable:active {
    cursor: grabbing;
    opacity: 0.8;
}

.question-in-canvas,
.design-element,
.question-separator {
    position: relative;
}

.question-in-canvas.dragging,
.design-element.dragging {
    opacity: 0.5;
    z-index: 1000;
}

.selection-box {
    position: absolute;
    border: 2px solid var(--color-accent);
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    display: none;
}

.selection-box.active {
    display: block;
}

/* ========================================
   MANUAL INPUT
   ======================================== */
.manual-input {
    margin-top: 16px;
}

.manual-input textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 8px;
}

.manual-input textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.btn-primary {
    width: 100%;
    padding: 10px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-action {
    width: 100%;
    padding: 10px;
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.btn-action:hover {
    background: var(--color-hover);
    border-color: var(--color-accent);
    transform: translateX(2px);
}

/* ========================================
   QUESTIONS LIST
   ======================================== */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--color-text-light);
    font-size: 13px;
}

.question-card {
    padding: 12px;
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s;
}

.question-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.question-card.dragging {
    opacity: 0.5;
}

.question-card img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 8px;
}

/* ========================================
   CANVAS AREA
   ======================================== */
.canvas-area {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.canvas-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

/* Pages Navigation */
.pages-nav {
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-hover);
}

.pages-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.page-tab {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-tab:hover {
    background: var(--color-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.page-tab.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.page-tab .delete-page-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.page-tab .delete-page-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.test-title {
    width: 100%;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 24px;
    font-weight: 600;
    background: transparent;
    margin-bottom: 12px;
}

.test-title:hover {
    background: var(--color-hover);
}

.test-title:focus {
    outline: none;
    border-color: var(--color-border);
    background: var(--color-surface);
}

.test-meta {
    display: flex;
    gap: 8px;
}

.meta-input {
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    background: var(--color-hover);
}

.meta-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-surface);
}

/* ========================================
   CANVAS PAPER
   ======================================== */
.canvas-paper {
    flex: 1;
    overflow-y: auto;
    background: var(--color-hover);
    padding: 40px;
}

.paper-content {
    background: white;
    /* A4 size: 210mm x 297mm = 793px x 1122px at 96dpi */
    width: 793px;
    min-height: 1122px;
    margin: 0 auto;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    position: relative;
    overflow: visible; /* Allow content to be visible */
}

/* Warning when page is overflowing */
.paper-content.overflowing::after {
    content: "⚠️ SAYFA DOLDU! Yeni sayfa ekleyin.";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ef4444;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 10000;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Watermark */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 80px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    user-select: none;
    z-index: 9999;
    white-space: nowrap;
}

/* Resizable Questions */
.question-in-canvas,
.design-element {
    resize: both;
    overflow: visible;
    position: relative;
}

.question-in-canvas img,
.design-element img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Remove Layout Button */
.remove-layout {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.remove-layout:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Test Header Info */
.test-info-header {
    border: 2px solid var(--color-accent);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 32px;
}

.test-info-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.test-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.test-info-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-info-field label {
    font-weight: 600;
    font-size: 13px;
    min-width: 120px;
    white-space: nowrap;
}

.test-info-field input,
.test-info-field .info-value {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: white;
    font-size: 13px;
}

.test-info-field input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.test-info-full {
    grid-column: 1 / -1;
}

/* Question Separator */
.question-separator {
    height: 1px;
    background: var(--color-border);
    margin: 8px 0;
    position: relative;
}

.question-separator.dashed {
    background: none;
    border-top: 2px dashed var(--color-border);
}

.question-separator.thick {
    height: 2px;
    background: var(--color-accent);
}

/* Page Footer */
.page-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: var(--color-text-light);
    padding: 0 40px;
}

.empty-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 600px;
    color: var(--color-text-light);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-canvas h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.empty-canvas p {
    font-size: 14px;
}

/* ========================================
   LAYOUT BLOCKS
   ======================================== */
.layout-block {
    display: grid;
    gap: 0;
    margin-bottom: 12px;
    padding: 8px;
    border: 1px dashed transparent;
    border-radius: 0;
    position: relative;
    min-height: 60px;
    overflow: visible;
}

.layout-block:hover {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.01);
}

.layout-block:hover .remove-layout {
    opacity: 1;
}

.remove-layout {
    opacity: 0.7;
}

.layout-block.single { grid-template-columns: 1fr; }
.layout-block.double {
    grid-template-columns: 1fr 2px 1fr;
}
.layout-block.triple {
    grid-template-columns: 1fr 2px 1fr 2px 1fr;
}
.layout-block.quad {
    grid-template-columns: 1fr 2px 1fr;
    grid-template-rows: auto 2px auto;
}

/* Column Separators */
.column-separator {
    background: var(--color-border);
    margin: 8px 0;
    width: 2px;
}

.row-separator {
    background: var(--color-border);
    margin: 0 8px;
    height: 2px;
    grid-column: 1 / -1;
}

.drop-zone {
    min-height: 60px;
    border: 1px dashed transparent;
    border-radius: 0;
    padding: 6px;
    background: transparent;
    transition: all 0.2s;
    overflow: visible;
}

.drop-zone:hover {
    border-color: rgba(0, 0, 0, 0.1);
}

.drop-zone.drag-over {
    background: rgba(0, 113, 227, 0.05);
    border-color: var(--color-accent);
    border-style: solid;
}

.drop-zone:empty::before {
    content: '';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text-light);
    font-size: 13px;
}

.drop-zone.hide-text:empty::before {
    content: '';
}

/* Settings */
.setting-group {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.setting-group:last-child {
    border-bottom: none;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    cursor: pointer;
}

.setting-label input[type="checkbox"] {
    cursor: pointer;
}

.setting-desc {
    font-size: 11px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.setting-select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    margin-top: 6px;
}

.setting-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.question-in-canvas {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 4px;
    position: relative;
}

.question-in-canvas img {
    max-width: 100%;
    border-radius: 4px;
}

/* Question Control Buttons */
.control-btn {
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.control-btn.remove-btn {
    background: #ef4444;
    border-radius: 50%;
    font-size: 18px;
}

.control-btn:hover {
    transform: scale(1.1);
    opacity: 1 !important;
}

.size-control {
    width: auto !important;
    min-width: 60px;
    background: #8b5cf6 !important;
}

.question-in-canvas:hover .control-btn,
.design-element:hover .control-btn {
    opacity: 1;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.question-in-canvas:hover .remove-btn,
.layout-block:hover .remove-btn {
    opacity: 1;
}

.remove-layout {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

/* ========================================
   LAYOUT CARDS
   ======================================== */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.layout-card {
    padding: 16px;
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.layout-card:hover {
    background: white;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.layout-preview {
    height: 60px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: var(--color-accent);
    opacity: 0.15;
}

.layout-preview.two {
    background: linear-gradient(to right, var(--color-accent) 48%, transparent 48%, transparent 52%, var(--color-accent) 52%);
}

.layout-preview.three {
    background: linear-gradient(to right,
        var(--color-accent) 31%, transparent 31%, transparent 34%,
        var(--color-accent) 34%, var(--color-accent) 65%, transparent 65%, transparent 68%,
        var(--color-accent) 68%);
}

.layout-preview.four {
    background:
        linear-gradient(var(--color-accent) 48%, transparent 48%, transparent 52%, var(--color-accent) 52%),
        linear-gradient(to right, var(--color-accent) 48%, transparent 48%, transparent 52%, var(--color-accent) 52%);
}

.layout-card span {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
}

/* ========================================
   DESIGN ELEMENTS
   ======================================== */
.elements-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.element-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-light);
    transition: all 0.2s;
}

.element-tab:hover {
    color: var(--color-text);
}

.element-tab.active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
}

.elements-content {
    display: none;
}

.elements-content.active {
    display: block;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.element-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 24px;
    cursor: grab;
    transition: all 0.2s;
}

.element-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.element-item:active {
    cursor: grabbing;
}

.element-item.shape {
    width: 100%;
    height: 100%;
}

/* ========================================
   BORDER OPTIONS
   ======================================== */
.border-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.border-item {
    padding: 12px;
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: grab;
    text-align: center;
    transition: all 0.2s;
}

.border-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.border-preview {
    width: 100%;
    height: 40px;
    margin-bottom: 8px;
    background: white;
}

.border-item span {
    font-size: 11px;
    color: var(--color-text-light);
}

/* ========================================
   DECORATIVE ELEMENTS ON CANVAS
   ======================================== */
.design-element {
    position: relative;
    display: inline-block;
    cursor: move;
}

.design-element.icon {
    font-size: 32px;
    padding: 8px;
}

.design-element.shape {
    width: 60px;
    height: 60px;
}

.design-element .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.toast {
    background: var(--color-accent);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    body {
        background: white;
    }

    .header,
    .sidebar,
    .pdf-area,
    .canvas-header,
    .remove-btn,
    .remove-layout {
        display: none !important;
    }

    .main-layout {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .canvas-area {
        border: none;
        border-radius: 0;
    }

    .canvas-paper {
        padding: 0;
        background: white;
    }

    .paper-content {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
    }

    .layout-block {
        border: none;
        break-inside: avoid;
    }

    .question-in-canvas {
        break-inside: avoid;
    }

    .test-info-header {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .test-info-field {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .test-info-field label {
        min-width: 80px;
        font-size: 11px;
    }

    .test-info-field input {
        flex: 1;
        min-width: 100px;
        border-bottom: 1px solid #000;
        border-top: none;
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding: 4px 0;
        background: transparent;
    }

    .page-footer {
        position: fixed;
        bottom: 10px;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1600px) {
    .main-layout {
        grid-template-columns: 260px 1fr 1fr 260px;
    }
}

@media (max-width: 1400px) {
    .main-layout {
        grid-template-columns: 1fr 1fr;
    }

    .sidebar {
        display: none;
    }
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .pdf-area {
        display: none;
    }
}

@media (max-width: 768px) {
    .canvas-paper {
        padding: 20px;
    }

    .paper-content {
        padding: 20px;
    }

    .layout-block.triple,
    .layout-block.double {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-hover);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-light);
}

/* ========================================
   MODAL STYLES
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content,
.modal-content-large {
    position: relative;
    background: white;
    border-radius: 12px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.modal-content {
    width: 500px;
    max-width: 90%;
}

.modal-content-large {
    width: 1000px;
    max-width: 90%;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--color-hover);
    border: none;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-accent);
    color: white;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* ========================================
   DESIGNS GRID
   ======================================== */
.designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.design-card {
    background: var(--color-hover);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.design-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.design-preview {
    height: 100px;
    background: white;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
}

.design-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.design-desc {
    font-size: 11px;
    color: var(--color-text-light);
}

.custom-preview {
    background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
}

.custom-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* ========================================
   CUSTOM BUILDER
   ======================================== */
.custom-builder {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.builder-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.builder-option label {
    font-size: 13px;
    font-weight: 500;
}

.builder-option select,
.builder-option input {
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.builder-option select:focus,
.builder-option input:focus {
    outline: none;
    border-color: var(--color-accent);
}
