/* Minimal Preview Area Enhancements - Clean and Professional */

/* Preview Header - Clean Typography */
.preview-header {
    margin-bottom: 12px;
}

.preview-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    letter-spacing: -0.025em;
}

/* Preview Subtitle - Subtle floating hint */
.canvas-wrapper {
    position: relative;
}

.preview-subtitle {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 12px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    z-index: 10;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.5);
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.preview-subtitle i {
    opacity: 0.7;
}

/* Show subtitle only when canvas has an image and placeholder is hidden */
.canvas-wrapper:has(.canvas-placeholder[style*="display: none"]) .preview-subtitle {
    display: flex;
}

/* Reduce opacity on canvas hover to not interfere with interaction */
.canvas-wrapper:hover .preview-subtitle {
    opacity: 0.4;
    transform: translateY(-2px);
}

/* Preview Info Section - Clean Layout */
.preview-info {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.info-label {
    color: #6b7280;
    font-weight: 500;
}

.info-value {
    color: #111827;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Color Display - Clean and Functional */
.color-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.color-hex {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

/* Toggle Switch - Refined Design */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Download Button - Clean and Prominent */
.preview-info .btn-premium {
    margin-top: 4px;
    width: 100%;
    justify-content: center;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Canvas Container - Subtle Border */
.canvas-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

/* Sync right panel height with left panel */
.converter-layout {
    align-items: stretch; /* Ensure both panels stretch to same height */
}

.right-panel .panel-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Make canvas container fill available space */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #fafbfc;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    margin: 16px;
    position: relative;
}

/* Canvas Placeholder - Clean Design */
.canvas-placeholder {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.canvas-placeholder h3 {
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
    margin: 16px 0 8px;
}

.canvas-placeholder p {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
}

.placeholder-icon {
    opacity: 0.4;
    color: #d1d5db !important;
    width: 64px !important;
    height: 64px !important;
    margin-bottom: 8px;
}

/* Ensure toolbar doesn't affect canvas height */
.toolbar {
    flex-shrink: 0;
}

/* Color Analysis Section - Clean Stats */
.color-analysis {
    margin-top: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.analysis-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.analysis-title svg {
    color: #6b7280;
}

.color-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.stat-item {
    color: #6b7280;
}

.stat-item strong {
    color: #111827;
    font-weight: 600;
}

.free-count {
    color: #10b981;
}

.paid-count {
    color: #f59e0b;
}

/* Used Colors Grid - Clean Layout */
.used-colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.color-note {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Pixel Tooltip - Refined Style */
.pixel-tooltip {
    position: absolute;
    background: rgba(17, 24, 39, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pixel-tooltip .color-preview {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Zoom Controls - Clean Design */
.zoom-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid #e5e7eb;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.zoom-slider {
    width: 100px;
    margin: 0 8px;
}

.zoom-value {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

/* Smooth Transitions */
.preview-info,
.color-analysis,
.canvas-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .preview-header h2 {
        font-size: 20px;
    }
    
    .info-row {
        gap: 12px;
    }
    
    .color-stats {
        font-size: 13px;
        gap: 12px;
    }
}