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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #202d48 0%, #1a2438 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    display: grid;
    grid-template-columns: 350px 1fr 1fr;
    gap: 15px;
    max-width: 1800px;
    margin: 0 auto;
    height: calc(100vh - 40px);
}

.panel {
    background: white;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.panel h1 {
    color: #f25835;
    margin: 0;
    font-size: 20px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.btn-lang {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 2px solid #202d48;
    border-radius: 4px;
    background: white;
    color: #202d48;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-lang svg {
    width: 18px;
    height: 12px;
}

.btn-lang:hover {
    background: #202d48;
    color: white;
    transform: scale(1.05);
}

.panel h3 {
    color: #333;
    margin: 10px 0 6px;
    font-size: 14px;
    border-bottom: 2px solid #202d48;
    padding-bottom: 3px;
}

.form-group {
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 3px;
    color: #555;
    font-weight: 600;
    font-size: 12px;
}

.form-group input {
    width: 100%;
    padding: 6px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #f25835;
    box-shadow: 0 0 0 3px rgba(242, 88, 53, 0.1);
}

.coord-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.coord-input label {
    display: block;
    margin-bottom: 3px;
    color: #555;
    font-weight: 600;
    font-size: 11px;
}

.coord-input input {
    width: 100%;
    padding: 5px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 11px;
    transition: all 0.3s;
}

.coord-input input:focus {
    outline: none;
    border-color: #f25835;
    box-shadow: 0 0 0 3px rgba(242, 88, 53, 0.1);
}

.btn-generate,
.btn-regenerate,
.btn-copy {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 6px;
}

.btn-generate {
    background: linear-gradient(135deg, #202d48 0%, #1a2438 100%);
    color: white;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(32, 45, 72, 0.5);
}

.btn-regenerate {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.btn-regenerate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.4);
}

.btn-copy {
    background: #f25835;
    color: white;
}

.btn-copy:hover {
    background: #d94d2d;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(242, 88, 53, 0.4);
}

.stats {
    text-align: center;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-top: 6px;
    font-weight: 600;
    color: #202d48;
    font-size: 13px;
}

#viewer {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.controls-tutorial {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(32, 45, 72, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.control-item {
    padding: 4px 0;
    white-space: nowrap;
    font-weight: 500;
}

#viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

.output {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: calc(100vh - 40px);
}

.output h3 {
    color: #f25835;
    margin-bottom: 15px;
    font-size: 18px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.output-header h3 {
    margin: 0;
}

.btn-copy-output {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: #f25835;
    color: white;
    white-space: nowrap;
}

.btn-copy-output:hover {
    background: #d94d2d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(242, 88, 53, 0.4);
}

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

.output pre {
    flex: 1;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #202d48;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f25835;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    #viewer {
        height: 400px;
    }
    
    .output {
        height: 400px;
    }
}
