/**
 * BEAUTIFIER.CSS - Screenshot Beautifier Tool
 * Light Theme - Professional & Premium
 */

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

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

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-light);
    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: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    box-shadow: var(--shadow);
}

.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: 20px; font-weight: 700; }
.logo__icon { width: 28px; height: 28px; color: var(--primary); }
.nav { display: flex; gap: 4px; }
.nav__link { padding: 10px 18px; 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-light); }
.nav__link--active { color: var(--primary); }

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

/* Upload Page */
.upload-box {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.upload-title { 
    font-size: 42px; 
    font-weight: 700; 
    margin-bottom: 16px;
    color: var(--primary);
}

.upload-desc { font-size: 18px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 40px; }
.upload-desc .highlight { color: var(--primary); font-weight: 600; }

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

.upload-btn {
    display: inline-flex;
    padding: 20px 56px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35);
}

.upload-btn:hover { 
    background: var(--primary-hover);
    transform: translateY(-3px); 
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.45);
}

.upload-hint { margin-top: 20px; font-size: 14px; color: var(--text-muted); }

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

.editor { display: flex; width: 100%; min-height: calc(100vh - 70px); }

.editor__canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: auto;
    background: var(--bg-light);
}

.canvas-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s;
}

/* Screenshot Frame */
.screenshot-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.25);
    max-width: 100%;
    transition: all 0.3s;
}

.screenshot-frame img {
    display: block;
    max-width: 800px;
    max-height: 500px;
    width: auto;
    height: auto;
}

/* Browser Bar */
.browser-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.browser-bar.visible { display: flex; }

.dots { display: flex; gap: 6px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; }
.dots span:nth-child(1) { background: #ff5f57; }
.dots span:nth-child(2) { background: #febc2e; }
.dots span:nth-child(3) { background: #28c840; }

.url-bar {
    flex: 1;
    height: 28px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* Window style */
.screenshot-frame.window-style .browser-bar {
    justify-content: flex-start;
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
}

.screenshot-frame.window-style .url-bar { display: none; }

/* Panel */
.editor__panel {
    width: 340px;
    padding: 24px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-title { 
    font-size: 20px; 
    font-weight: 600; 
    margin-bottom: 24px; 
    text-align: center;
    color: var(--text);
}

/* Setting Groups */
.setting-group { margin-bottom: 20px; }
.setting-group > label { 
    display: block; 
    font-size: 13px; 
    font-weight: 500; 
    color: var(--text-secondary); 
    margin-bottom: 10px; 
}

/* Gradient Grid */
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.gradient-btn {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.gradient-btn:hover { transform: scale(1.1); }
.gradient-btn.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }

.gradient-btn.custom {
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    font-size: 16px;
}

.gradient-btn.custom input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Slider */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 3px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

/* Frame & Size Buttons */
.frame-btns, .size-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.size-btns { grid-template-columns: repeat(4, 1fr); }

.frame-btn, .size-btn {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
    cursor: pointer;
}

.frame-btn:hover, .size-btn:hover { border-color: var(--primary); color: var(--text); }
.frame-btn.active, .size-btn.active { 
    background: var(--primary-light); 
    border-color: var(--primary); 
    color: var(--primary); 
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    margin-top: auto;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.download-btn:hover { 
    background: var(--primary-hover);
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
    cursor: pointer;
}

.action-btn:hover { border-color: var(--primary); color: var(--text); }
.action-btn svg { width: 16px; height: 16px; }

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

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

/* Share Modal */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.share-modal.active { opacity: 1; visibility: visible; }

.share-modal__content {
    position: relative;
    padding: 32px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    text-align: center;
    min-width: 320px;
    box-shadow: var(--shadow-lg);
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.share-modal h3 { font-size: 18px; margin-bottom: 20px; color: var(--text); }

.share-buttons { display: flex; gap: 12px; justify-content: center; }

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.share-btn svg { width: 18px; height: 18px; }

.share-btn--twitter { background: #1da1f2; }
.share-btn--twitter:hover { background: #0c8bd9; }

.share-btn--facebook { background: #1877f2; }
.share-btn--facebook:hover { background: #0d65d9; }

.share-btn--linkedin { background: #0077b5; }
.share-btn--linkedin:hover { background: #005e8f; }

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

/* Responsive */
@media (max-width: 900px) {
    .editor { flex-direction: column; }
    .editor__canvas { min-height: 50vh; padding: 20px; }
    .editor__panel { width: 100%; border-left: none; border-top: 1px solid var(--border); }
    .canvas-wrapper { padding: 32px; }
    .screenshot-frame img { max-width: 100%; }
}

@media (max-width: 600px) {
    .upload-title { font-size: 32px; }
    .nav { display: none; }
    .gradient-grid { grid-template-columns: repeat(4, 1fr); }
    .size-btns { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: 1fr; }
}

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

.editor__canvas { animation: fadeIn 0.5s ease; }
