/* ===== VARIABLES CSS ===== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-white: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
    --border-radius-sm: 8px;
    --padding-sm: 8px;
    --padding-md: 15px;
    --font-size-xs: 9px;
    --transition: all 0.3s ease;
}

/* Animación de transición para el modelo 3D */

.fade-in {
    animation: fadeInModel 1.5s ease;
}

@keyframes fadeInModel {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* ===== BARRA DE NAVEGACIÓN INTEGRADA ===== */
.navigation-bar {
    background: var(--bg-white);
    padding: var(--padding-sm) 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.nav-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-title h1 {
    color: #333;
    font-size: 16px;
    margin: 0;
}

.shortcuts {
    font-size: var(--font-size-xs);
    color: #666;
    margin: 0;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
}

.model-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 110px;
}

.model-info span {
    font-weight: bold;
    color: #333;
    font-size: 13px;
}

#goto-model {
    width: 70px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

/* ===== BOTONES ===== */
button {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    background: #667eea;
    color: white;
    border-color: #667eea;
}

button:hover:not(:disabled) {
    background: #5a6fd8;
}

button:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    border-color: #ccc;
}

/* ===== ÁREA DE VISUALIZACIÓN ===== */
.viewer-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    flex: 1;
    align-items: stretch;
    min-height: 0;
    width: 100%;
}

.viewer-3d {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: var(--padding-md);
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.orthographic-views {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.view-item {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: var(--padding-sm);
    box-shadow: var(--shadow);
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    display: block;
}

#canvas-3d {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.view-label {
    position: absolute;
    top: 10px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* ===== BARRA DE COPYRIGHT ===== */
.copyright-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em 1em;
}

.copyright,
.github-link {
    margin: 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .viewer-container {
        grid-template-columns: 3fr 2fr;
    }
}

@media (max-width: 992px) {
    .viewer-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .orthographic-views {
        flex-direction: row;
        justify-content: space-around;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    .viewer-3d {
        min-height: 50vh;
    }

    .orthographic-views {
        flex-direction: column;
        height: auto;
    }

    .navigation-bar {
        flex-direction: column;
        gap: 6px;
        padding: 6px 8px;
    }

    .nav-title {
        text-align: center;
        flex-direction: column;
        gap: 2px;
    }

    .nav-controls {
        gap: 4px;
        padding: 2px 6px;
    }

    .nav-title h1 {
        font-size: 14px;
    }

    .shortcuts {
        font-size: var(--font-size-xs);
    }

    button {
        padding: 4px 8px;
        font-size: 11px;
    }
}
