/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background-color: #1a1a1a;
    color: #cccccc;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #1a1a1a;
    padding: 20px;
    box-sizing: border-box;
}

/* Header Styles */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 20px;
    width: 100%;
}

.header .logo {
    width: 1000px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #cccccc;
    text-align: center;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.canvas-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.canvas-controls .btn-primary {
    flex: 0 0 auto;
    min-width: 120px;
    max-width: none;
}

/* Button Styles */
.btn-primary {
    background-color: #bf5926;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    transition: background-color 0.2s;
    min-width: 140px;
    letter-spacing: 0.5px;
}

.btn-primary:hover:not(:disabled) {
    background-color: #d6734a;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #3a3a3a;
}

.btn-small {
    background-color: #bf5926;
    color: #ffffff;
    border: 1px solid #bf5926;
    position: relative;
    z-index: 1;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.75rem;
    transition: all 0.2s;
    min-width: 30px;
    user-select: none;
    -webkit-user-select: none;
}

.btn-small:hover:not(:disabled) {
    background-color: #d6734a;
    border-color: #d6734a;
    color: #ffffff;
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2a2a;
    border-color: #444;
    color: #cccccc;
    pointer-events: none;
}

/* Ensure grid spacing buttons always show accent color when enabled */
.input-with-buttons .btn-small:not(:disabled) {
    background-color: #bf5926 !important;
    border-color: #bf5926 !important;
    color: #ffffff !important;
}

.input-with-buttons .btn-small:not(:disabled):hover {
    background-color: #d6734a !important;
    border-color: #d6734a !important;
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

.left-panel,
.right-panel {
    width: 280px;
    flex-shrink: 0;
    background-color: #1f1f1f;
    border: 1px solid #333;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    overflow-x: clip;
    max-height: fit-content;
    position: relative;
    align-self: flex-start;
}

.left-panel .control-section,
.right-panel .control-section {
    overflow: visible;
    position: relative;
}

.left-panel .form-group,
.right-panel .form-group,
.left-panel .checkbox-group,
.right-panel .checkbox-group {
    overflow: visible;
    position: relative;
}

.preview-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    padding: 20px;
    max-width: 680px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.preview-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    position: relative;
    gap: 20px;
    box-sizing: border-box;
}

.preview-canvas {
    width: 100%;
    max-width: 100%;
    background-color: #000000;
    position: relative;
    flex-shrink: 0;
    margin: 0 auto 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.preview-canvas canvas {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    width: auto;
    display: block;
}

/* Control Sections */
.control-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.horizontal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.form-group.horizontal .label {
    flex-shrink: 0;
    margin-bottom: 0;
}

.form-group.horizontal .input-with-buttons {
    flex: 1;
    max-width: 200px;
    justify-content: flex-end;
}

.form-group.horizontal .slider-container {
    flex: 1;
    max-width: 200px;
}

.label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #cccccc;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: 'Arial', sans-serif;
    width: 100%;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #bf5926;
}

.input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2a2a;
}

.form-group:has(.input-field:disabled) .label {
    opacity: 0.5;
}

.form-group.horizontal:has(.input-field:disabled) .label {
    opacity: 0.5;
}

.form-group:has(.input-field:disabled) label.label {
    opacity: 0.5;
    color: #666;
}

.form-group.disabled .label {
    opacity: 0.5;
    color: #666;
}

.form-group.disabled .input-field {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2a2a;
}

.form-group.disabled .btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2a2a;
    border-color: #444;
    color: #cccccc;
    pointer-events: none;
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2a2a;
    border-color: #444;
    color: #cccccc;
    pointer-events: none;
}

.input-with-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-with-buttons .input-field {
    flex: 1;
    min-width: 80px;
    max-width: 150px;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-with-suffix .input-field {
    flex: 1;
    min-width: 80px;
    max-width: 150px;
}

.unit-suffix {
    color: #999;
    font-size: 0.85rem;
    padding: 0 5px;
}

/* Style native number input spinners */
.number-input {
    -moz-appearance: textfield;
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    cursor: pointer;
    height: 20px;
    width: 20px;
}

/* Dropdown */
.dropdown {
    position: relative;
    width: 100%;
}

.dropdown select {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #cccccc;
    padding: 8px 30px 8px 12px;
    font-size: 0.9rem;
    font-family: 'Arial', sans-serif;
    cursor: pointer;
    appearance: none;
    outline: none;
    transition: border-color 0.2s;
}

.dropdown select:focus {
    border-color: #bf5926;
}

.dropdown::after {
    content: '▼';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #bf5926;
    pointer-events: none;
    font-size: 0.7rem;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #bf5926;
}

.checkbox-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker {
    flex: 1;
    height: 40px;
    border: 1px solid #444;
    background-color: #2a2a2a;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    min-width: 0;
}

.btn-color-ok {
    background-color: #bf5926;
    color: #ffffff;
    border: 1px solid #bf5926;
    padding: 6px 16px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-color-ok:hover {
    background-color: #d6734a;
    border-color: #d6734a;
}

.color-picker:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group:has(.color-picker:disabled) .label {
    opacity: 0.5;
}

/* Slider */
.slider-container {
    width: 100%;
    flex: 1;
    max-width: 200px;
}

.slider {
    width: 100%;
    height: 6px;
    background-color: #2a2a2a;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    display: block;
}

.slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background-color: #2a2a2a;
    border-radius: 3px;
    border: 1px solid #444;
}

.slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background-color: #2a2a2a;
    border-radius: 3px;
    border: 1px solid #444;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background-color: #bf5926;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: #bf5926;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Info Text */
.info-text {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Thumbnail */
.thumbnail-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background-color: #2a2a2a;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thumbnail-placeholder span {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 10px;
}

.thumbnail-placeholder .thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    max-width: 100%;
    max-height: 100%;
}

.thumbnail-placeholder .thumb[src]:not([src=""]):not([src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="]) {
    display: block !important;
}

.thumbnail-placeholder:has(.thumb[src]:not([src=""]):not([src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="])) span {
    display: none;
}

/* Bottom Panel */
.bottom-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    position: relative;
}

.bottom-panel-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 4px;
}

.bottom-panel .form-group {
    overflow: visible;
    position: relative;
}

@media (max-width: 768px) {
    .bottom-panel {
        grid-template-columns: 1fr;
    }
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    margin: 20px 0;
    padding: 0 20px;
    font-family: 'Courier New', Courier, monospace;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #000000;
    border: 2px solid #bf5926;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 0 1px #000000;
}

.progress-bar-fill {
    height: 100%;
    background-color: #bf5926;
    border-radius: 0;
    transition: none;
    min-width: 2px;
    box-shadow: 0 0 8px #bf5926;
}

.progress-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    color: #bf5926;
    text-align: left;
    margin-top: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: normal;
    text-shadow: 0 0 5px #bf5926;
}

/* Status and Stats */
.status {
    font-size: 0.85rem;
    color: #cccccc;
    text-align: center;
    margin: 10px 0;
}

.meta {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay[hidden] {
    display: none;
}

.overlay .box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top-color: #bf5926;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.badge {
    background-color: #bf5926;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer Navigation */
.page-footer {
    max-width: 1200px;
    margin: 3rem auto 2rem;
    padding: 2rem 1.5rem 0;
    border-top: 2px solid #333;
}

.page-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.page-footer nav a {
    color: #cccccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.page-footer nav a:hover {
    color: #bf5926;
    text-decoration: underline;
}

.page-footer p {
    text-align: center;
    opacity: 0.8;
    font-size: 0.875rem;
    margin: 0;
    color: #cccccc;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
        max-height: none;
    }
    
    .header {
        width: 100%;
    }
    
    .header .logo {
        width: 100%;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .bottom-panel {
        grid-template-columns: 1fr;
    }
    
    .bottom-panel .form-group.horizontal {
        width: 100%;
    }
    
    .title {
        font-size: 2rem;
    }
}

/* Tooltip styles completely removed */
.label {
    position: relative;
}

