/* LcF Viewer Styles */

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

:root {
    --primary-color: #0066cc;
    --secondary-color: #00aa00;
    --background-color: #f5f5f5;
    --surface-color: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --success-color: #00cc00;
    --error-color: #cc0000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    color: #666;
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: var(--surface-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background-color: #f0f7ff;
    border-color: #0052a3;
}

.upload-area.dragover {
    background-color: #e6f2ff;
    border-color: #0052a3;
}

#fileInput {
    display: none;
}

.upload-text {
    margin: 10px 0;
    font-size: 1.1em;
    color: #666;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

.btn-primary:hover {
    background-color: #0052a3;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #008800;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

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

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

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

/* Viewer Section */
.viewer-section {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.viewer-section h2 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.canvas-container {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    overflow: auto;
    margin-bottom: 15px;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Info Section */
.info-section {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-section h2 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.info-section h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.info-panel {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-options .btn {
    width: 100%;
}

/* Metadata Section */
.metadata-section {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.metadata-section h2 {
    margin-bottom: 15px;
}

.metadata-panel {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    font-size: 0.9em;
}

.metadata-item {
    margin-bottom: 10px;
    padding: 8px;
    background-color: white;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

/* Animation Section */
.animation-section {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.animation-section h2 {
    margin-bottom: 15px;
}

.animation-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.slider {
    flex: 1;
    min-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

#frameCounter {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

/* Stats Section */
.stats-section {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-section h2 {
    margin-bottom: 15px;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stats-panel p {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.stats-panel span {
    font-weight: bold;
    color: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0 20px;
    border-top: 2px solid var(--border-color);
    color: #666;
}

/* Loading and Error States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.error-message {
    background-color: #ffe6e6;
    border: 1px solid var(--error-color);
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
    color: var(--error-color);
}

.success-message {
    background-color: #e6ffe6;
    border: 1px solid var(--success-color);
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
    color: var(--success-color);
}

/* Utility Classes */
section {
    animation: fadeIn 0.3s ease-in;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .stats-panel {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .controls .btn {
        width: 100%;
    }
}
