/* ============================================
   SVG to PNG Converter - Stylesheet
   Theme: Blue/Cyan
   ============================================ */

/* CSS Variables */
:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --primary-light: #5dade2;
    --accent: #1abc9c;
    --accent-dark: #16a085;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --bg-page: #f0f9ff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.2s ease;
}

/* Tool Container */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
}

.tool-icon-wrapper {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.tool-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-description {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Main Tool Area */
.tool-main {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 30px;
    margin-bottom: 30px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 0;
}

.upload-area {
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.03), rgba(26, 188, 156, 0.03));
}

.upload-area:hover {
    border-color: var(--primary-dark);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(26, 188, 156, 0.08));
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.1), rgba(52, 152, 219, 0.1));
    border-style: solid;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 10px;
}

.upload-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.upload-subtitle {
    color: var(--text-secondary);
    margin: 0;
}

.upload-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--border-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-browse {
    margin-top: 10px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Editor Section */
.editor-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* Panels */
.preview-panel,
.settings-panel {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(26, 188, 156, 0.05));
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Preview Container */
.preview-container {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

.preview-container img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.file-info {
    padding: 12px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

/* Settings Panel */
.settings-panel {
    padding-bottom: 20px;
}

.setting-group {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.setting-group:last-of-type {
    border-bottom: none;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.setting-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Dimensions */
.dimensions-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.dimension-input {
    flex: 1;
}

.dimension-input label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.dimension-input input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--bg-card);
    transition: var(--transition);
}

.dimension-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.dimension-x {
    color: var(--text-muted);
    font-size: 18px;
    padding-bottom: 10px;
}

.ratio-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ratio-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.ratio-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Preset Sizes */
.preset-sizes {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preset-label {
    font-size: 12px;
    color: var(--text-muted);
}

.preset-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.preset-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Background Options */
.background-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.bg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    color: var(--text-secondary);
}

.bg-option:hover {
    border-color: var(--primary-light);
}

.bg-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(52, 152, 219, 0.05);
}

.bg-option input {
    display: none;
}

.bg-preview {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.bg-preview.transparent {
    background: repeating-conic-gradient(#e2e8f0 0% 25%, white 0% 50%) 50% / 10px 10px;
}

.bg-preview.white {
    background: white;
}

.bg-preview.black {
    background: #1e293b;
}

.color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Scale Slider */
.scale-slider-container {
    padding: 10px 0;
}

.scale-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--primary-light), var(--accent));
    outline: none;
    -webkit-appearance: none;
}

.scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.4);
    transition: var(--transition);
}

.scale-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.scale-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

#scaleValue {
    font-weight: 600;
    color: var(--primary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 15px 20px 0;
}

.action-buttons .btn {
    flex: 1;
}

/* Progress Container */
.progress-container {
    grid-column: 1 / -1;
    margin-top: 25px;
    text-align: center;
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Results Section - Replaces Editor */
.results-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(52, 152, 219, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    background: rgba(16, 185, 129, 0.1);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.result-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--success);
    margin: 0;
}

.result-preview {
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(#f8fafc 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    min-height: 220px;
}

.result-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.result-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.result-stats .stat-item i {
    color: var(--primary);
}

.result-stats .stat-text {
    display: flex;
    flex-direction: column;
}

.result-stats .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.result-stats .stat-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    justify-content: center;
}

.result-actions .btn {
    min-width: 180px;
}

/* Error Message */
.error-message {
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Related Tools */
.related-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.related-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.related-link:hover {
    background: var(--primary);
    color: white;
}

/* Info Sections */
.info-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 25px 30px;
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}

.info-card h2 i {
    color: var(--primary);
}

/* Steps List */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: steps;
}

.steps-list li {
    position: relative;
    padding-left: 50px;
    padding-bottom: 20px;
    counter-increment: steps;
}

.steps-list li:last-child {
    padding-bottom: 0;
}

.steps-list li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps-list li strong {
    color: var(--text-primary);
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.comparison-col {
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.comparison-col h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 15px 0;
}

.comparison-col h4 i {
    color: var(--primary);
}

.comparison-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comparison-col li {
    position: relative;
    padding-left: 20px;
    padding-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.comparison-col li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-input);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(52, 152, 219, 0.05);
}

.faq-question i {
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 15px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-answer p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon-box {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-info .stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .tool-container {
        padding: 20px 15px;
    }
    
    .tool-title {
        font-size: 24px;
    }
    
    .tool-main {
        padding: 20px;
    }
    
    .editor-section {
        grid-template-columns: 1fr;
    }
    
    .background-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-stats {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tool-title-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .dimensions-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .dimension-x {
        display: none;
    }
    
    .preset-sizes {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-box {
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }
    
    .related-tools {
        flex-direction: column;
        align-items: stretch;
    }
    
    .related-links {
        justify-content: center;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-stats .stat-item {
        justify-content: center;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
