/* ==========================================================================
   PLS-CADD DXF & KMZ Suite - Estilos Web Modernos
   ========================================================================== */

:root {
    --bg-color: #080D18;
    --surface-color: #101827;
    --card-color: #151F31;
    --input-color: #0C1422;
    --border-color: #263650;
    --text-color: #E8F0FA;
    --muted-color: #8FA3BD;
    --accent-color: #2F81F7;
    --accent-hover: #4C9AFF;
    --cyan-color: #38BDF8;
    --success-color: #22C55E;
    --danger-color: #EF4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.2);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.25rem;
    gap: 1.25rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(16, 24, 39, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1E40AF, #38BDF8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.brand h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.accent-text { color: var(--cyan-color); }
.subtitle { font-size: 0.85rem; color: var(--muted-color); }

.status-badge {
    background: #122B4A;
    color: var(--cyan-color);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.25rem;
    flex: 1;
}

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

/* Sidebar & Cards */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cyan-color);
}

/* Drop Zone */
.drop-card { background: var(--card-color); }

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--input-color);
    position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--cyan-color);
    background: rgba(56, 189, 248, 0.05);
}

.file-input-hidden {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}

.drop-icon { color: var(--cyan-color); margin-bottom: 0.25rem; }
.drop-prompt { font-weight: 600; font-size: 0.9rem; color: var(--text-color); }
.drop-subtext { font-size: 0.75rem; color: var(--muted-color); margin-bottom: 0.5rem; }

.file-name-display {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cyan-color);
    background: #122B4A;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    word-break: break-all;
}

.info-help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563EB;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 0.35rem;
    vertical-align: middle;
    transition: var(--transition);
}

.info-help-icon:hover {
    background: #38BDF8;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Tooltip emergente de ayuda instantáneo */
.info-help-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #060D13;
    color: #E8F0FA;
    border: 1px solid #38BDF8;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 400;
    white-space: normal;
    width: 250px;
    text-align: center;
    line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
}

.info-help-icon::before {
    content: '';
    position: absolute;
    bottom: 112%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #38BDF8 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.info-help-icon:hover::after,
.info-help-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}



/* Navegación por Pestañas (Tabs) inspiradas en la imagen del usuario */
.config-tabs {
    display: flex;
    background: var(--input-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--muted-color);
    padding: 0.6rem 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.tab-btn:hover { color: var(--text-color); }
.tab-btn.active {
    background: #1D4ED8;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.4);
}

.tab-btn.highlight-tab.active {
    background: linear-gradient(135deg, #1E3A8A, #1D4ED8);
    border: 1px solid #3B82F6;
}

.tab-content-container {
    flex: 1;
}

.tab-pane {
    display: none;
}

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

/* Forms & Inputs */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.form-row { display: flex; gap: 0.75rem; width: 100%; min-width: 0; }
.form-group.half { flex: 1 1 0%; min-width: 0; width: 50%; }

label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-control {
    background-color: var(--input-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.form-control:focus {
    border-color: var(--cyan-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}


.info-box {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.78rem;
    color: var(--muted-color);
    line-height: 1.4;
}

/* Custom Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.5rem;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none; border: none; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; background: none;
}

.color-val { font-size: 0.78rem; font-family: monospace; color: var(--text-color); }

/* Checkbox */
.checkbox-container {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.82rem; color: var(--text-color); user-select: none;
}

/* Action Header Bar (Barra de generación inspirada en la imagen del usuario) */
.content-panel { display: flex; flex-direction: column; gap: 1rem; }

.action-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface-color);
}

@media (max-width: 900px) {
    .action-header-bar { flex-direction: column; align-items: stretch; }
}

.status-indicator-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--input-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--muted-color);
    flex: 1;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748B;
}

.status-dot.active {
    background: var(--success-color);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.action-buttons-group {
    display: flex;
    gap: 0.75rem;
}

.btn-action-primary {
    background: linear-gradient(135deg, #1D4ED8, #2563EB);
    color: #ffffff;
    border: 1px solid #3B82F6;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-action-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.btn-action-success {
    background: linear-gradient(135deg, #059669, #10B981);
    color: #ffffff;
    border: 1px solid #34D399;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-action-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #10B981, #34D399);
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

.btn-action-primary:disabled, .btn-action-success:disabled {
    opacity: 0.4; cursor: not-allowed; border-color: var(--border-color);
}

/* Canvas & Viewers Wrapper */
.canvas-wrapper {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 440px;
}

.canvas-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--card-color);
    border-bottom: 1px solid var(--border-color);
}

.view-switch-tabs {
    display: flex;
    gap: 0.4rem;
}

.view-tab {
    background: none;
    border: 1px solid transparent;
    color: var(--muted-color);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.view-tab:hover { color: var(--text-color); }
.view-tab.active {
    background: var(--input-color);
    border-color: var(--border-color);
    color: var(--cyan-color);
}

.toolbar-controls { display: flex; gap: 0.4rem; }

.icon-btn {
    background: var(--input-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition);
}

.icon-btn:hover { border-color: var(--cyan-color); color: var(--cyan-color); }

.canvas-container { position: relative; flex: 1; background: #04070D; overflow: hidden; }

.view-panel { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.view-panel.active { display: block; }

#dxf-canvas, #profile-canvas { width: 100%; height: 100%; display: block; }
#gis-map { width: 100%; height: 100%; background: #04070D; }

.canvas-overlay-message {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; color: var(--muted-color); display: flex; flex-direction: column; align-items: center; gap: 0.75rem; pointer-events: none;
}

/* Results Card & Download Button (Inspirado en la imagen del usuario) */
.results-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.check-icon { font-size: 1.2rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-label { font-size: 0.72rem; text-transform: uppercase; color: var(--muted-color); }
.stat-value { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; color: #ffffff; }
.stat-suspension .stat-value { color: #22C55E; }
.stat-anchor .stat-value { color: #EF4444; }
.sheet-name-val { font-size: 1.1rem; color: var(--cyan-color); word-break: break-all; }

.btn-download-big {
    background: linear-gradient(135deg, #0284C7, #0369A1);
    color: #ffffff;
    border: 1px solid #38BDF8;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.btn-download-big:hover {
    background: linear-gradient(135deg, #0369A1, #075985);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

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