/* ============================================
   SVG Downloader
   Dark Mode Support with Light Mode Default
   Green Theme for SVG Tools
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors - Green Theme for SVG Tools */
    --primary: #339966;
    --primary-light: #e6f5ed;
    --primary-dark: #2a7d54;
    --accent: #4db882;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    /* Background Colors */
    --bg: #f0faf5;
    --bg-elevated: #ffffff;
    --bg-secondary: #f0f9f4;
    --bg-tertiary: #e0f2ea;
    
    /* Text Colors */
    --text: #1a3a2a;
    --text-secondary: #1e5f3c;
    --text-muted: #6b7280;
    
    /* Border Colors */
    --border: #c6e6d5;
    --border-light: #d5eddf;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --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);
    --shadow-primary: 0 4px 14px rgba(51, 153, 102, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(51, 153, 102, 0.35);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Checkerboard for transparency */
    --checker-light: #f3f4f6;
    --checker-dark: #e5e7eb;
    
    /* Input */
    --input-bg: #ffffff;
    --input-border: #c6e6d5;
    
    /* Mode Tab Colors - Light Mode */
    --tab-bg: #f0f9f4;
    --tab-text: #6b7280;
    --tab-hover-bg: #e0f2ea;
    --tab-hover-text: #1a3a2a;
    --tab-active-bg: #ffffff;
    --tab-active-text: #339966;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary: #4db882;
    --primary-light: rgba(77, 184, 130, 0.15);
    --primary-dark: #339966;
    --accent: #7dd3a8;
    
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    
    --bg: #0d1a14;
    --bg-elevated: #162519;
    --bg-secondary: #1e3528;
    --bg-tertiary: #2a4a38;
    
    --text: #eaf5ef;
    --text-secondary: #c6e6d5;
    --text-muted: #a8a8b3;
    
    --border: #2a4a38;
    --border-light: #3a5f4a;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
    --shadow-primary: 0 4px 14px rgba(77, 184, 130, 0.2);
    --shadow-primary-hover: 0 6px 20px rgba(77, 184, 130, 0.3);
    
    --checker-light: #1e3528;
    --checker-dark: #2a4a38;
    
    --input-bg: #1e3528;
    --input-border: #2a4a38;
    
    --tab-bg: #162519;
    --tab-text: #b8b8c5;
    --tab-hover-bg: #2a4a38;
    --tab-hover-text: #eaf5ef;
    --tab-active-bg: #2a4a38;
    --tab-active-text: #7dd3a8;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Container */
.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-primary);
}

.tool-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

.tool-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}

.tool-description a {
    color: var(--primary);
    text-decoration: none;
}

.tool-description a:hover {
    text-decoration: underline;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--tab-bg);
    padding: 0.375rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--tab-text);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.mode-tab:hover {
    color: var(--tab-hover-text);
    background: var(--tab-hover-bg);
}

.mode-tab.active {
    background: var(--tab-active-bg);
    color: var(--tab-active-text);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* Main Tool Area */
.tool-main {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Input Section */
.input-section,
.batch-section {
    width: 100%;
}

.url-input-container,
.batch-input-area {
    margin-bottom: 1.5rem;
}

.input-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.input-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.input-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.url-input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.url-input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.url-input::placeholder {
    color: var(--text-muted);
}

.paste-btn {
    padding: 0 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.paste-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
    border-color: var(--primary);
}

.paste-btn svg {
    width: 20px;
    height: 20px;
}

/* Batch Tabs */
.batch-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--tab-bg);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.batch-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tab-text);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.batch-tab:hover {
    color: var(--tab-hover-text);
    background: var(--tab-hover-bg);
}

.batch-tab.active {
    background: var(--tab-active-bg);
    color: var(--tab-active-text);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* Batch Textarea */
.batch-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-family: monospace;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text);
    resize: vertical;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.batch-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.batch-textarea::placeholder {
    color: var(--text-muted);
}

/* Input Hints */
.input-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-fetch {
    width: 100%;
    padding: 1rem;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    border-radius: var(--radius-sm);
}

.btn-text:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Format Badges */
.format-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.badges-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.badge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text);
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 3rem;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border: 4px solid #e0e0e0;
    border-top-color: #339966;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

[data-theme="dark"] .loading-spinner {
    border-color: #2a4a38;
    border-top-color: #4db882;
}

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

.loading-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

#loadingStatus {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Preview Section */
.preview-section {
    padding: 1.5rem 0;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.preview-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.preview-header-left svg {
    color: var(--primary);
}

.preview-content {
    margin-bottom: 1.5rem;
}

.svg-preview-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(var(--checker-light) 0% 25%, var(--checker-dark) 0% 50%) 50% / 20px 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 250px;
    max-height: 450px;
    padding: 1.5rem;
}

.svg-preview-wrapper img {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: var(--radius-md);
}

/* SVG Code Preview */
.svg-code-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.svg-code-wrapper {
    margin-top: 0.5rem;
    max-height: 200px;
    overflow: auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.svg-code-wrapper pre {
    margin: 0;
    padding: 1rem;
    font-size: 0.8rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text);
}

/* SVG Info Panel */
.svg-info-panel {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.svg-info-panel .info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.svg-info-panel .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.svg-info-panel .info-item svg {
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.svg-info-panel .info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.svg-info-panel .info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.source-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.source-url svg {
    flex-shrink: 0;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Download Options */
.download-options {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.options-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.options-header svg {
    color: var(--primary);
}

.options-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.option-label svg {
    color: var(--text-muted);
}

.option-input,
.option-select {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--transition-speed);
}

.option-input:focus,
.option-select:focus {
    outline: none;
    border-color: var(--primary);
}

.option-select {
    cursor: pointer;
}

/* PNG Options Panel */
.png-options-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.png-option {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.png-option label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.png-option label svg {
    width: 14px;
    height: 14px;
}

.png-option input,
.png-option select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
}

.png-option input:focus,
.png-option select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Format Info */
.format-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.format-info svg {
    flex-shrink: 0;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 1rem;
}

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

/* Success Section */
.success-section {
    text-align: center;
    padding: 3rem;
}

.success-content {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.success-section .success-icon,
#successSection .success-icon {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 1.5rem auto !important;
    background: #D1FAE5 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #10B981 !important;
    font-size: inherit !important;
}

.success-section .success-icon svg,
#successSection .success-icon svg {
    width: 40px !important;
    height: 40px !important;
}

[data-theme="dark"] .success-section .success-icon,
[data-theme="dark"] #successSection .success-icon {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #4ade80 !important;
}

.success-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

#successMessage {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.next-actions {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.next-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.next-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: center;
}

.next-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    color: var(--text);
    text-decoration: none;
    font-size: 0.8125rem;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

.next-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Batch Results Section */
.batch-results-section {
    padding: 1.5rem 0;
}

.batch-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.batch-results-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.batch-results-title svg {
    color: var(--primary);
}

.batch-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 0.125rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.batch-actions-top {
    display: flex;
    gap: 0.5rem;
}

.batch-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}

.batch-svg-card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

.batch-svg-card:hover {
    border-color: var(--primary);
}

.batch-svg-card.selected {
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

.batch-svg-checkbox {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
}

.batch-svg-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.batch-svg-thumb {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(var(--checker-light) 0% 25%, var(--checker-dark) 0% 50%) 50% / 10px 10px;
    padding: 0.5rem;
}

.batch-svg-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.batch-svg-info {
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.batch-download-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.selected-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text);
}

.selected-info svg {
    color: var(--primary);
}

.selected-size {
    color: var(--text-muted);
}

/* ZIP Download Links Panel */
.zip-links-panel {
    margin-top: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.zip-links-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.zip-links-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.zip-links-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

.zip-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zip-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.zip-link-item:hover {
    background: var(--primary-light);
}

.zip-link-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-size: 0.95rem;
}

.zip-link-left svg {
    color: var(--primary);
    flex-shrink: 0;
}

.zip-link-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.zip-link-item a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.zip-link-item a:hover {
    background: var(--primary-dark);
}

.zip-link-item.failed {
    opacity: 0.6;
}

.zip-link-item.failed .zip-link-left svg {
    color: var(--danger);
}

.zip-link-item.failed .zip-link-status {
    font-size: 0.85rem;
    color: var(--danger);
}

.zip-link-item.processing {
    opacity: 0.7;
}

.zip-link-item.processing .zip-link-left svg {
    color: var(--text-muted);
}

.zip-links-expire {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 1rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.zip-links-expire svg {
    flex-shrink: 0;
}

/* Error Display */
.error-message {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--danger-light);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
}

.error-message svg:first-child {
    flex-shrink: 0;
    color: var(--danger);
}

#errorText {
    flex: 1;
    font-size: 0.95rem;
    color: var(--danger);
}

.error-close {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-speed);
}

.error-close:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Related Tools */
.related-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.related-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-speed);
}

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

/* Info Sections */
.info-sections {
    margin-top: 3rem;
}

.info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text);
}

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

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

.steps-list li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.steps-list a {
    color: var(--primary);
    text-decoration: none;
}

.steps-list a:hover {
    text-decoration: underline;
}

.steps-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
}

.steps-tip svg {
    flex-shrink: 0;
    color: var(--primary);
}

.steps-tip a {
    color: var(--primary);
    text-decoration: none;
}

.steps-tip a:hover {
    text-decoration: underline;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.feature-item svg {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.feature-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Use Cases Grid */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.use-case {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
}

.use-case svg {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.use-case h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.use-case p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.use-case a {
    color: var(--primary);
    text-decoration: none;
}

.use-case a:hover {
    text-decoration: underline;
}

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

.faq-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question svg {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform var(--transition-speed);
}

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

.faq-answer {
    display: none;
    padding: 0 1.25rem 1rem;
}

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

.faq-answer p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-answer a {
    color: var(--primary);
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .tool-title {
        font-size: 1.75rem;
    }
    
    .tool-icon-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .tool-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }
    
    .tool-main {
        padding: 1.25rem;
    }
    
    .mode-tabs {
        flex-direction: column;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .action-bar .btn {
        width: 100%;
    }
    
    .batch-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .batch-download-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .batch-download-bar .btn {
        width: 100%;
    }
    
    .batch-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .batch-actions-top {
        width: 100%;
        justify-content: flex-start;
    }
    
    .png-options-panel {
        grid-template-columns: 1fr;
    }
    
    .svg-info-panel .info-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .next-links {
        flex-wrap: wrap;
    }
}

/* Scrollbar Styling */
.batch-results-grid::-webkit-scrollbar {
    width: 8px;
}

.batch-results-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.batch-results-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.batch-results-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Spin Animation */
.spin {
    animation: spin 1s linear infinite;
}
