/* Premium String Art Generator Styles */

:root {
    --primary-color: #000000;
    --primary-hover: #1a1a1a;
    --secondary-color: #6b7280;
    --border-color: #e5e7eb;
    --background: #ffffff;
    --panel-bg: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #212529;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* Main Layout */
.tool-container {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
    flex-direction: column;
}

@media (min-width: 768px) {
    .tool-container {
        flex-direction: row;
    }
}

/* Control Panel */
.control-panel {
    width: 100%;
    background: #ffffff;
    overflow-y: auto;
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .control-panel {
        width: 420px;
        border-bottom: none;
        border-right: 1px solid #dee2e6;
    }
}

.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

.control-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Section Styles */
.control-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #000000;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Form Controls */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #495057;
}

.value-display {
    font-weight: 600;
    color: #212529;
    background: #f8f9fa;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.radio-option {
    flex: 1;
}

.radio-input {
    position: absolute;
    opacity: 0;
}

.radio-label {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.radio-input:checked + .radio-label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.radio-label:hover {
    border-color: var(--primary-color);
}

/* Slider Controls */
.slider-group {
    margin-bottom: 1.5rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.slider-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.slider-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 50px;
    text-align: right;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-input {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Info Text */
.info-text {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.info-text p {
    margin: 0;
    font-size: 0.8125rem;
    color: #004085;
    line-height: 1.4;
}

.info-text p:not(:last-child) {
    margin-bottom: 0.25rem;
}

.info-text strong {
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    text-align: center;
}

.btn-primary {
    background: #212529;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #000000;
}

.btn-primary:disabled {
    background: #ced4da;
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-secondary {
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-file {
    position: relative;
    overflow: hidden;
}

/* File Upload Button */
.file-upload-btn {
    position: relative;
    overflow: hidden;
}

.file-upload-btn input[type="file"] {
    position: absolute;
    left: -9999px;
}

/* Text Input */
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out;
    background: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: #495057;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* Preset Controls */
.preset-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.preset-input {
    flex: 1;
}

.preset-save-btn {
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
}

.preset-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.preset-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.preset-item:hover {
    background: var(--panel-bg);
}

.no-presets {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.5rem;
    text-align: center;
}

/* Export Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--panel-bg);
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f1f3f5;
    min-height: 400px;
}

@media (min-width: 768px) {
    .canvas-area {
        padding: 2rem;
    }
}

.canvas-container {
    background: #ffffff;
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    display: inline-block;
}

.canvas-wrapper {
    position: relative;
    text-align: center;
}

.canvas-wrapper.hidden {
    display: none;
}

canvas {
    display: block;
    margin: 0 auto;
    border: 2px solid #e9ecef;
    background: white;
}

.centerImage {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.centerCanvasMedium {
    width: 85vw;
    height: 85vw;
    max-width: 500px;
    max-height: 500px;
    border-radius: 50%;
}

.centerCanvasLarge {
    width: 90vw;
    height: 90vw;
    max-width: 600px;
    max-height: 600px;
    border-radius: 50%;
}

@media (min-width: 768px) {
    .centerCanvasMedium {
        width: 500px;
        height: 500px;
    }
    
    .centerCanvasLarge {
        width: 600px;
        height: 600px;
    }
}

.caption {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Placeholder Circle */
.placeholder-circle {
    width: 90vw;
    height: 90vw;
    max-width: 600px;
    max-height: 600px;
    border-radius: 50%;
    border: 2px dashed #e9ecef;
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (min-width: 768px) {
    .placeholder-circle {
        width: 600px;
        height: 600px;
    }
}

.placeholder-content {
    text-align: center;
    color: #6c757d;
}

.placeholder-content svg {
    margin: 0 auto 1rem;
    color: #adb5bd;
}

.placeholder-content p {
    margin: 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: #495057;
}

.placeholder-subtitle {
    font-size: 0.875rem !important;
    color: #6c757d !important;
    font-weight: 400 !important;
}

/* Progress Overlay */
.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    z-index: 10;
}

.progress-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.progress-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 200px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Status Messages */
.status-message {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Image Preview */
.image-preview {
    margin-top: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .tool-container {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .canvas-area {
        padding: 1rem;
    }
}

/* Additional UI Elements */
textarea#pinsOutput {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    resize: vertical;
}

.centerBorderless {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.centerBorderless button {
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.centerBorderless button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

#incrementalCurrentStep {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #495057;
    font-weight: 500;
}