/* ========================================
   TECH EM NÚMEROS - INTERFACE DO EDITOR
   Design System: Odd Prototype
   Layout A2 Canvas: 2504x1753px
   ======================================== */

/* === RESET E BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 16px;
}

/* === LAYOUT PRINCIPAL === */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* === PAINEL DE EDIÇÃO === */
.editor-panel {
    width: 380px;
    background: #ffffff;
    border-right: 1px solid #e5e5e5;
    padding: 24px;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.editor-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e5e5;
}

.editor-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1a1a1a;
    letter-spacing: -0.025em;
}

.editor-header p {
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    letter-spacing: 0.025em;
}

.editor-header .credits {
    margin-top: 8px;
}

.editor-header .credits a {
    font-size: 12px;
    color: #999999;
    text-decoration: none;
    transition: color 200ms ease-in-out;
    letter-spacing: 0.025em;
}

.editor-header .credits a:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

/* === SEÇÕES DO EDITOR === */
.editor-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.section-description {
    font-size: 14px;
    color: #666666;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* === FORMULÁRIOS === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #1a1a1a;
    letter-spacing: 0.025em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 200ms ease-in-out;
    background: #ffffff;
    color: #1a1a1a;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #333333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #666666;
}

/* === ABAS === */
.visualization-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

.tab-button {
    flex: 1;
    min-width: 0;
    padding: 10px 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    color: #666666;
    border-bottom: 2px solid transparent;
    transition: all 200ms ease-in-out;
    margin-bottom: -1px;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    line-height: 1.3;
}

.tab-button:hover {
    color: #1a1a1a;
    background: #f8f9fa;
}

.tab-button.active {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

.tab-content {
    display: none;
}

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

/* === INPUTS DE CARDS === */
.card-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-input-group {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #1a1a1a;
    transition: all 200ms ease-in-out;
}

.card-input-group:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-input-group h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
    letter-spacing: 0.025em;
}

.card-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.card-input-row:last-child {
    margin-bottom: 0;
}

.card-input-row label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #333333;
    display: flex;
    align-items: center;
}

.card-input-row input {
    width: 110px;
    padding: 8px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
}

.card-input-row input:focus {
    border-color: #333333;
}

/* === BOTÕES === */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease-in-out;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.btn-primary {
    background: #1a1a1a;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: #333333;
    transform: translateY(-0.5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #e5e5e5;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #333333;
}

.btn-full {
    width: 100%;
    margin-bottom: 10px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* === ÁREA DE CANVAS === */
.canvas-area {
    margin-left: 380px;
    padding: 32px;
    flex: 1;
    min-height: 100vh;
    background: #fafafa;
}

.canvas-container {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
}

.canvas-header {
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-info {
    font-size: 14px;
    color: #333333;
}

.canvas-info strong {
    font-weight: 600;
    color: #1a1a1a;
}

.canvas-wrapper {
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
}

#mainCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* === RESPONSIVIDADE === */
@media (max-width: 1200px) {
    .editor-panel {
        transform: translateX(-100%);
        transition: transform 300ms ease-in-out;
    }

    .editor-panel.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    }

    .canvas-area {
        margin-left: 0;
    }

    /* Botão de toggle para mobile */
    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        left: 20px;
        top: 20px;
        z-index: 101;
        width: 48px;
        height: 48px;
        background: #1a1a1a;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        align-items: center;
        justify-content: center;
        transition: all 200ms ease-in-out;
    }

    .mobile-menu-toggle:hover {
        background: #333333;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .mobile-menu-toggle:active {
        transform: translateY(0);
    }

    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
        color: #ffffff;
    }

    /* Overlay backdrop quando sidebar está aberta */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        transition: opacity 300ms ease-in-out;
    }

    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }
}

@media (min-width: 1201px) {
    .mobile-menu-toggle {
        display: none;
    }

    .sidebar-backdrop {
        display: none !important;
    }
}

/* === UTILITÁRIOS === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* === LOADING STATES === */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #1a1a1a;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === SEÇÃO DE QUALIDADE DO PDF === */
.editor-section.collapsible .section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease-in-out;
}

.editor-section.collapsible.expanded .section-content {
    max-height: 1000px;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    transition: color 200ms ease-in-out;
}

.collapsible-header:hover {
    color: #333333;
}

.collapse-icon {
    font-size: 12px;
    transition: transform 300ms ease-in-out;
    color: #666666;
}

.editor-section.collapsible.expanded .collapse-icon {
    transform: rotate(180deg);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #666666;
    margin-top: 6px;
    line-height: 1.4;
}

.quality-estimates {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
    border-left: 3px solid #1a1a1a;
}

.estimate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.estimate-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.estimate-label {
    font-size: 13px;
    font-weight: 500;
    color: #333333;
}

.estimate-value {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.estimate-quality {
    background: #1a1a1a;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* === SCROLLBAR CUSTOMIZADA === */
.editor-panel::-webkit-scrollbar {
    width: 6px;
}

.editor-panel::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.editor-panel::-webkit-scrollbar-thumb {
    background: #e5e5e5;
    border-radius: 3px;
}

.editor-panel::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* === TRANSIÇÕES GLOBAIS === */
* {
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

button, a, input, select {
    transition-property: all;
}
