:root {
    --primary-color: #5ca7ff;
    --primary-hover: #7db8ff;
    --secondary-color: #2a3f5f;
    --accent-color: #ff6b6b;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --background-color: #1a1a1a;
    --card-background: #2b2b2b;
    --input-background: #1e1e1e;
    --border-color: #3a3a3a;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 10px 20px rgba(0, 0, 0, 0.5);
    --success-color: #4ade80;
    --error-color: #f87171;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    padding: 30px;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    border: 1px solid var(--border-color);
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 2em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.input-section, .output-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--input-background);
}

.file-input-wrapper:hover {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
}

.file-input-wrapper.dragging {
    border-color: var(--primary-color);
    background-color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(92, 167, 255, 0.2);
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-input-wrapper .icon {
    font-size: 3em;
    color: var(--primary-color);
}

.file-input-wrapper p {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-muted);
    font-weight: 400;
    text-align: center;
}

.image-preview {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    margin-top: 20px;
    display: none;
    max-height: 300px;
    object-fit: contain;
    border: 1px solid var(--border-color);
}

.file-info-area {
    text-align: center;
}

.file-info .label {
    font-weight: 600;
    color: var(--primary-color);
}

.file-info .value {
    color: var(--text-color);
}

.footer {
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9em;
    line-height: 1.6;
}

.metadata-output {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-color);
    position: relative; /* For copy button positioning */
}

.metadata-output::-webkit-scrollbar {
    width: 10px;
}

.metadata-output::-webkit-scrollbar-track {
    background: var(--card-background);
    border-radius: 5px;
}

.metadata-output::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

.metadata-output::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.metadata-output strong {
    color: var(--primary-color);
    font-weight: 600;
}

.metadata-output pre {
    margin: 0;
    padding: 0;
}

.metadata-output .json-syntax {
    color: #82aaff;
}
.metadata-output .json-value {
    color: #c3e88d;
}
.metadata-output .json-number {
    color: #f78c6c;
}
.metadata-output .json-boolean {
    color: #ff6b6b;
}
.metadata-output .json-null {
    color: #717cb4;
}
.metadata-output .chunk-header {
    color: #c792ea;
    font-weight: 600;
    margin-top: 1em;
    display: block;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.button-group {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.btn {
    background-color: var(--primary-color);
    color: #1a1a1a;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(92, 167, 255, 0.3);
}

.btn:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(92, 167, 255, 0.4);
    transform: translateY(-1px);
}

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

.message {
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 500;
    text-align: center;
    border: 1px solid;
}

.message.success {
    background-color: rgba(74, 222, 128, 0.1);
    color: var(--success-color);
    border-color: var(--success-color);
}

.message.error {
    background-color: rgba(248, 113, 113, 0.1);
    color: var(--error-color);
    border-color: var(--error-color);
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: none;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.6em;
    }
    .file-input-wrapper p {
        font-size: 1em;
    }
    .btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}