/* LcF Viewer Styles */

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

:root {
    --primary-color: #a78bfa;
    --secondary-color: #438cff;
    --background-color: #080910;
    --surface-color: #11131e;
    --text-color: #f0efff;
    --border-color: #303147;
    --success-color: #4ade80;
    --error-color: #fb7185;
}

body {
    font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse at 12% 0%, rgba(91, 65, 180, 0.18), transparent 42%),
        linear-gradient(145deg, #080910 0%, #0d1020 55%, #090b13 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.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: #aaa9c3;
}

/* 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: #17192a;
    border-color: var(--secondary-color);
}

.upload-area.dragover {
    background-color: #18172c;
    border-color: var(--primary-color);
}

#fileInput {
    display: none;
}

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

/* 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: linear-gradient(110deg, #7954d9, #4b78e8);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(110deg, #8a65eb, #5e8cf7);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #080910;
    font-weight: 700;
}

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

.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%;
    }
}

.canvas-container,
.info-panel,
.metadata-panel,
.stats-panel p {
    background-color: #0b0c15;
    color: var(--text-color);
}

.metadata-item {
    background-color: #151725;
}

.viewer-section,
.info-section,
.metadata-section,
.animation-section,
.stats-section {
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

footer {
    border-top: 1px solid var(--border-color);
    color: #aaa9c3;
}

.error-message {
    background-color: #29121c;
}

.success-message {
    background-color: #10241d;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.olyra-credit {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 7px 13px 7px 8px;
    border: 1px solid #8b70d6;
    border-radius: 8px;
    background: #efedff;
    color: #7153c7;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    transition: transform 160ms ease, border-color 160ms ease;
}

.olyra-credit:hover {
    transform: translateY(-2px);
    border-color: #438cff;
}

.olyra-credit img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.olyra-credit strong {
    color: #11121b;
}

@media (max-width: 768px) {
    .olyra-credit {
        right: 12px;
        bottom: 12px;
    }
}
