/* Image Histogram Generator - Tool-specific styles */

/* Ensure proper spacing below nav */
.tool-container {
    margin-top: 60px;
}

/* Upload Zone */
.upload-zone {
    background: #0a0a0a;
    border: 2px dashed #374151;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    position: relative;
    margin-bottom: 24px;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #3b82f6;
    background: #1e3a8a20;
}

.upload-zone.has-image {
    padding: 24px;
    border-style: solid;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: #6b7280;
}

.upload-text {
    font-size: 16px;
    color: #e5e7eb;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: #6b7280;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
}

/* Output Section */
.output-section {
    background: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
}

.output-section.hidden {
    display: none;
}

/* Histogram Tabs */
.histogram-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.histogram-tab {
    padding: 10px 16px;
    background: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.histogram-tab:hover {
    background: #374151;
    color: #e5e7eb;
}

.histogram-tab.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.histogram-tab.active[data-channel="red"] {
    background: #dc2626;
    border-color: #dc2626;
}

.histogram-tab.active[data-channel="green"] {
    background: #16a34a;
    border-color: #16a34a;
}

.histogram-tab.active[data-channel="blue"] {
    background: #2563eb;
    border-color: #2563eb;
}

.histogram-tab.active[data-channel="luminosity"] {
    background: #6b7280;
    border-color: #6b7280;
}

/* Histogram Container */
.histogram-container {
    background: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

#histogram-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.histogram-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 4px;
    font-size: 11px;
    color: #6b7280;
    font-family: 'SF Mono', Monaco, monospace;
}

/* Statistics Section */
.stats-section {
    margin-bottom: 24px;
}

.stats-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.stat-indicator {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.stat-indicator.red {
    background: #ef4444;
}

.stat-indicator.green {
    background: #22c55e;
}

.stat-indicator.blue {
    background: #3b82f6;
}

.stat-indicator.luminosity {
    background: #9ca3af;
}

.stat-values {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
}

.stat-value {
    font-size: 14px;
    font-family: 'SF Mono', Monaco, monospace;
    color: #e5e7eb;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.export-actions .btn-secondary,
.export-actions .btn-primary {
    flex: 1;
    min-width: 140px;
}

/* Pro Badge */
.pro-badge {
    display: inline-block;
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.empty-state p {
    font-size: 15px;
}

/* Notification */
.copy-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #059669;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.copy-notification.visible {
    opacity: 1;
}

/* Loading State */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .histogram-tabs {
        justify-content: center;
    }
    
    .histogram-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .export-actions {
        flex-direction: column;
    }
    
    .export-actions .btn-secondary,
    .export-actions .btn-primary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
