:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --border-color: #334155;
    --radius-lg: 12px;
    --radius-md: 8px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    background-color: var(--accent-hover);
}

.container {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
    flex: 1;
}

@media (min-width: 1024px) {
    .container {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .left-pane, .right-pane {
        width: 50%;
    }
}

.left-pane, .right-pane {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 0.8rem;
    margin-top: -0.5rem;
    font-style: italic;
}

.file-upload {
    margin-bottom: 1.5rem;
}

input[type="file"]::file-selector-button {
    background-color: var(--border-color);
    color: var(--text-primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-right: 1rem;
    transition: background-color 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background-color: #475569;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.control-row label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: 1rem;
    position: relative;
    border: 1px solid var(--border-color);
    max-width: 288px;
    aspect-ratio: 1;
}

canvas {
    background-color: #000;
    image-rendering: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    display: block;
    width: 256px;
    height: 256px;
}

#source-canvas, #dft-canvas, #basis-canvas {
    width: 256px;
    height: 256px;
}

.dft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

select {
    background-color: var(--border-color);
    color: var(--text-primary);
    border: 1px solid #475569;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    outline: none;
    font-family: inherit;
}

.interactable {
    cursor: crosshair;
}

.info-box {
    margin-top: 1.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-box h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.value-display {
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent-hover);
    word-break: break-all;
}

.crosshair {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: none;
    z-index: 10;
}
.crosshair::before {
    content: '';
    position: absolute;
    top: 50%; left: -4px; right: -4px;
    height: 1px;
    background: #ff3b3b;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.crosshair::after {
    content: '';
    position: absolute;
    left: 50%; top: -4px; bottom: -4px;
    width: 1px;
    background: #ff3b3b;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
