/**
 * SIZE-INCREASER.CSS - Image Size Increaser Tool
 */

:root {
    --bg: #f8f9fa;
    --bg-white: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(139, 92, 246, 0.1);
    --success: #22c55e;
    --border: #e0e0e0;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select { font: inherit; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner { display: flex; align-items: center; justify-content: space-between; }
.back-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #f5f5f5; border-radius: 10px; color: #333; margin-right: 12px; transition: all 0.2s; text-decoration: none; }
.back-btn:hover { background: var(--primary); color: white; }
.back-btn svg { width: 20px; height: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.logo__icon { width: 28px; height: 28px; color: var(--primary); }
.nav { display: flex; gap: 4px; }
.nav__link { padding: 8px 14px; font-size: 14px; font-weight: 500; color: var(--text-secondary); border-radius: 6px; transition: all 0.2s; }
.nav__link:hover { color: var(--text); background: var(--bg); }
.nav__link--active { color: var(--primary); background: var(--primary-light); }

/* Pages */
.page { display: none !important; flex: 1; }
.page.active { display: flex !important; align-items: center; justify-content: center; }

/* Upload Page */
#page-upload { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-white) 100%); }

.upload-box {
    text-align: center;
    padding: 50px 20px;
    max-width: 580px;
    margin: 0 auto;
}

.upload-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 18px;
}

.upload-icon svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.upload-title { font-size: 38px; font-weight: 700; margin-bottom: 14px; }
.upload-desc { font-size: 16px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 32px; }
.upload-desc .highlight { color: var(--primary); font-weight: 600; }

.dropzone { display: flex; flex-direction: column; align-items: center; }

.upload-btn {
    display: inline-flex;
    padding: 18px 48px;
    font-size: 17px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.upload-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.upload-hint { margin-top: 14px; font-size: 14px; color: var(--text-muted); }

.use-cases {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.use-cases h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.use-case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.use-case-tags span {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 20px;
}

/* Editor Page */
#page-editor.active { display: flex !important; align-items: stretch; justify-content: stretch; }

.editor {
    display: flex;
    width: 100%;
    max-width: 950px;
    margin: 30px auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Preview Area */
.editor__preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg);
    min-width: 0;
}

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

.add-more-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.add-more-btn:hover { background: rgba(139, 92, 246, 0.2); }

.image-counter {
    font-size: 13px;
    color: var(--text-muted);
}

.preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 280px;
}

.preview-area img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 4px;
}

.current-size {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.current-size strong {
    color: var(--primary);
}

/* Settings Panel */
.editor__settings {
    width: 340px;
    flex-shrink: 0;
    padding: 28px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

.settings-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Target Size */
.target-size-group label,
.presets-group label,
.setting-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.target-input-row {
    display: flex;
    gap: 10px;
}

.target-input-row input {
    flex: 1;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.target-input-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.target-input-row select {
    width: 80px;
    padding: 14px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    cursor: pointer;
}

/* Presets */
.presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.preset {
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.preset:hover { border-color: var(--primary); color: var(--primary); }
.preset.active { color: var(--primary); background: var(--primary-light); border-color: var(--primary); }

/* Setting Row */
.setting-row select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    cursor: pointer;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: var(--radius);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.info-box svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Increase Button */
.increase-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.increase-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.increase-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.increase-btn svg { width: 20px; height: 20px; }

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--success);
}

.privacy-note svg { width: 14px; height: 14px; }

/* Download Page */
#page-download.active { display: flex !important; }

.download-box {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.success-icon { width: 80px; height: 80px; margin: 0 auto 24px; color: var(--success); }
.success-icon svg { width: 100%; height: 100%; }

.download-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.download-info { font-size: 16px; color: var(--primary); font-weight: 500; margin-bottom: 20px; }

/* Size Comparison */
.size-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-lg);
}

.size-item {
    text-align: center;
}

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

.size-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-secondary);
}

.size-value.new {
    color: var(--success);
}

.size-arrow {
    font-size: 24px;
    color: var(--text-muted);
}

.results {
    margin-bottom: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-height: 150px;
    overflow-y: auto;
}

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

.result-thumb { width: 40px; height: 40px; object-fit: contain; background: #fafafa; border-radius: 4px; }
.result-info { flex: 1; }
.result-name { font-size: 13px; font-weight: 500; }
.result-sizes { font-size: 12px; color: var(--text-muted); }
.result-sizes span { color: var(--success); font-weight: 600; }

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 40px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--success);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    margin-bottom: 24px;
}

.download-btn:hover { background: #16a34a; transform: translateY(-2px); }
.download-btn svg { width: 22px; height: 22px; }

/* Share */
.share-section { margin-bottom: 24px; padding: 20px; background: var(--bg); border-radius: var(--radius-lg); }
.share-label { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.share-buttons { display: flex; justify-content: center; gap: 10px; }

.share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.share-btn svg { width: 20px; height: 20px; }
.share-btn--facebook { background: #1877f2; color: white; }
.share-btn--twitter { background: #1da1f2; color: white; }
.share-btn--whatsapp { background: #25d366; color: white; }
.share-btn--copy { background: var(--bg-white); border: 1px solid var(--border); color: var(--text-secondary); }
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.more-actions { display: flex; align-items: center; justify-content: center; gap: 16px; }
.link-btn { font-size: 14px; font-weight: 500; color: var(--primary); }
.link-btn:hover { text-decoration: underline; }
.divider { color: var(--text-muted); }

/* Processing */
.processing {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.processing.active { opacity: 1; visibility: visible; }
.processing__modal { text-align: center; }

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.processing__modal p { font-size: 16px; color: var(--text-secondary); margin-bottom: 16px; }

.progress { width: 200px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--primary); transition: width 0.2s; }

/* Footer */
.footer {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-white);
    margin-top: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .editor {
        flex-direction: column;
        margin: 20px;
        max-height: none;
    }
    
    .editor__settings {
        width: 100%;
        max-height: none;
    }
    
    .nav { display: none; }
}

@media (max-width: 500px) {
    .upload-title { font-size: 28px; }
    .editor__settings { padding: 24px 20px; }
    .presets { grid-template-columns: repeat(2, 1fr); }
    .size-comparison { flex-direction: column; gap: 16px; }
    .size-arrow { transform: rotate(90deg); }
}

