/*
 * Crop Field Drawing App
 * Design System: Morten Sylvest Studio
 * Dark monospace aesthetic
 */

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

body {
    font-family: 'Courier New', monospace;
    background: #000000;
    color: #d4d4d4;
    min-height: 100vh;
    font-size: 10px;
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    background: #000000;
    border-bottom: 1px solid #262626;
    padding: 24px 0;
    margin-bottom: 32px;
}

header h1 {
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: #d4d4d4;
    text-transform: uppercase;
    margin-bottom: 8px;
}

header p {
    color: #737373;
    font-size: 10px;
    font-weight: 300;
}

.main-content {
    display: flex;
    gap: 24px;
}

.controls-panel {
    width: 280px;
    flex-shrink: 0;
}

.control-section {
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 12px;
}

.control-section h3 {
    color: #a3a3a3;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.01em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.button-group {
    display: flex;
    gap: 8px;
}

.button-group.vertical {
    flex-direction: column;
}

.btn {
    padding: 12px 24px;
    background: #171717;
    color: #d4d4d4;
    border: 1px solid #262626;
    border-radius: 4px;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #1f1f1f;
    border-color: #404040;
}

.btn:focus-visible {
    outline: 2px solid #525252;
    outline-offset: 2px;
}

.btn.active {
    background: #262626;
    border-color: #404040;
    color: #ffffff;
}

.btn.primary {
    background: #0a1f0a;
    border-color: #1a3d1a;
    color: #4ade80;
}

.btn.primary:hover {
    background: #0f2d0f;
    border-color: #2d5a2d;
}

.btn.danger {
    background: #1f0a0a;
    border-color: #3d1a1a;
    color: #f87171;
}

.btn.danger:hover {
    background: #2d0f0f;
    border-color: #5a2d2d;
}

label {
    display: block;
    margin-bottom: 12px;
    color: #a3a3a3;
    font-size: 10px;
    font-weight: 300;
}

input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 4px;
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    transition: all 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #525252;
    background: #0f0f0f;
}

input[type="number"]::placeholder {
    color: #525252;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    margin-top: 8px;
    background: #262626;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #4ade80;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #22c55e;
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4ade80;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #22c55e;
    transform: scale(1.2);
}

.instructions {
    background: #0a0a0a;
    padding: 16px;
    border-radius: 4px;
    border-left: 2px solid #262626;
}

.instructions p {
    color: #737373;
    font-size: 9px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.instructions p:last-child {
    margin-bottom: 0;
}

.instructions strong {
    color: #a3a3a3;
    font-weight: 500;
}

.canvas-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.canvas-header {
    background: #0a0a0a;
    border: 1px solid #262626;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-header h2 {
    color: #737373;
    font-size: 10px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.viewport-info {
    display: flex;
    gap: 16px;
    font-size: 9px;
    color: #525252;
    font-family: 'Courier New', monospace;
}

.canvas-container {
    flex-grow: 1;
    background: #000000;
    border: 1px solid #262626;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    position: relative;
}

#fieldCanvas {
    display: block;
    cursor: crosshair;
    background: #000000;
}

/* File input (hidden but styled when visible) */
input[type="file"] {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #d4d4d4;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .controls-panel {
        width: 100%;
    }

    .container {
        padding: 1rem;
    }

    header {
        padding: 16px 0;
        margin-bottom: 24px;
    }
}

@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Loading state */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Success/Error messages */
.message {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 10px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
}

.message.success {
    background: #0a1f0a;
    border: 1px solid #1a3d1a;
    color: #4ade80;
}

.message.error {
    background: #1f0a0a;
    border: 1px solid #3d1a1a;
    color: #f87171;
}

/* Code/technical elements */
code, pre {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: #d4d4aa;
}

/* Selection highlight */
::selection {
    background: #262626;
    color: #ffffff;
}
