/* ========================================
   GOEDITPDF EDITOR - STYLES ORGANISÉS
   ======================================== */

/* --- ROOT VARIABLES --- */
:root {
    --primary: #FF3B30;
    --dark: #1a1a1a;
    --light: #f5f5f7;
    --border: #e1e1e6;
    --danger: #a1565d;
    --active-ring: rgba(255, 59, 48, 0.4);
}

/* --- BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #e9ecef;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- HEADER --- */
.top-bar {
    background: white;
    height: 60px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    flex-shrink: 0;
    z-index: 30;
    position: relative;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.hamburger {
    display: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    background: #f9f9f9;
    outline: none;
}

/* --- WORKSPACE --- */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    overflow-y: auto;
    z-index: 20;
    transition: transform 0.3s ease;
}

.tool-section {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1rem;
}

.tool-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* --- BUTTONS --- */
.btn-tool {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.btn-tool:hover {
    background: var(--light);
    border-color: #ccc;
}

.btn-tool.active {
    background: #fff0f0;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-tool.secured {
    border-color: #28a745;
    color: #28a745;
    background: #f0fff4;
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 6px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 8px;
}

.tools-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-bottom: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    justify-content: center;
}

.btn-primary:hover {
    background: #a19393;
}

.btn-secondary {
    background: #333;
    color: white;
    border: none;
    font-weight: 600;
    justify-content: center;
}

.btn-secondary:hover {
    background: #000;
}

.btn-danger {
    color: var(--danger);
    border-color: #ffebeb;
}

.btn-danger:hover {
    background: #fff5f5;
    border-color: var(--danger);
}

/* --- SCROLL AREA --- */
.scroll-area {
    flex: 1;
    background: #df4141;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 0;
    scroll-behavior: smooth;
    width: 100%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><circle cx="16" cy="16" r="14" fill="rgba(247,255,255,0.9)" stroke="rgba(0,0,0,0.3)" stroke-width="2"/><circle cx="16" cy="16" r="4" fill="rgba(0,0,0,0.6)"/></svg>') 32 32, auto;
}

.pages-transform-wrapper {
    transition: transform 0.2s ease-out;
    transform-origin: top center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
    width: 100%;
}

.page-wrapper {
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    background: white;
    transition: box-shadow 0.2s;
    max-width: 100%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><circle cx="14" cy="14" r="12" fill="rgba(255,255,255,0.95)" stroke="rgba(0,0,0,0.4)" stroke-width="2"/><circle cx="14" cy="14" r="3" fill="rgba(0,0,0,0.7)"/></svg>') 14 14, pointer;
}

.page-wrapper.active-page {
    box-shadow: 0 0 0 5px var(--active-ring);
}

.page-info-tag {
    position: absolute;
    top: -25px;
    left: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

/* --- FLOATING PROPERTIES --- */
.floating-props {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    display: none;
    z-index: 100;
}

.prop-row {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prop-label {
    font-size: 0.8rem;
    color: #666;
    width: 60px;
}

.prop-input {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* --- UPLOAD SCREEN --- */
.upload-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone {
    border: 3px dashed #e1e1e6;
    padding: 4rem;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 90%;
    background: #fffbfb;
}

.upload-zone:hover {
    transform: scale(1.02);
    border-color: var(--primary);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background-color: rgba(255, 59, 48, 0.05);
    transform: scale(1.05);
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal {
    background: white;
    padding: 20px;
    border-radius: 16px;
    width: 500px;
    max-width: 90%;
}

.ocr-result-area {
    width: 100%;
    height: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 15px 0;
    font-family: monospace;
    resize: vertical;
}

/* --- TOAST --- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: none;
    z-index: 3000;
    white-space: nowrap;
}

/* --- ZOOM CONTROLS --- */
.zoom-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 5px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 5px;
    z-index: 90;
}

.btn-zoom {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: 0.2s;
}

.btn-zoom:hover {
    background: #f0f0f0;
}