/* Vauvision Brand Colors - Light Theme */
:root {
    --black: #131313;
    --white: #ffffff;
    --bg-light: #f5f5f5;
    --bg-card: #ffffff;
    --beige: #e4dfd8;
    --vinous: #ab1115;
    --yellow: #e2b63f;
    --text-primary: #131313;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: rgba(19, 19, 19, 0.1);
    --accent: #ab1115;
}

/* Dark Theme */
body.dark {
    --bg-light: #0a0a0a;
    --bg-card: #1a1a1a;
    --text-primary: #e5e5e5;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #d41920;
}

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

html, body {
    height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
}

body {
    background: var(--bg-light);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    flex-shrink: 0;
    padding: 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.header-left,
.header-right {
    width: 50px;
    display: flex;
    justify-content: center;
}

.logo-link {
    display: inline-flex;
    align-items: center;
}

.logo-img {
    height: 32px;
    object-fit: contain;
}

.theme-toggle-btn,
.lang-toggle-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.2s;
}

.theme-toggle-btn:hover,
.lang-toggle-btn:hover {
    border-color: var(--text-muted);
}

.theme-toggle-btn {
    font-size: 18px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    overflow: auto;
}

.content-wrapper {
    width: 100%;
    max-width: 600px;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.7s ease;
}

.content-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Title */
.title-section {
    text-align: center;
    margin-bottom: 16px;
}

.title-section h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Warning Card */
.warning-card {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

body.dark .warning-card {
    background: rgba(171, 17, 21, 0.15);
    border-color: rgba(171, 17, 21, 0.3);
}

.warning-text {
    font-size: 12px;
    font-weight: 700;
    color: #cc0000;
    line-height: 1.4;
}

body.dark .warning-text {
    color: #ff6666;
}

/* Info Card */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.info-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.info-text a {
    color: var(--accent);
    text-decoration: none;
}

.info-text a:hover {
    text-decoration: underline;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mode-tab {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab:hover {
    border-color: var(--text-muted);
}

.mode-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.card-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(171, 17, 21, 0.05);
}

.upload-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.upload-content {
    text-align: left;
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

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

/* Format Tabs */
.format-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.format-tab {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.format-tab:hover {
    border-color: var(--text-muted);
}

.format-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Editor */
.editor-card {
    padding: 16px;
}

.editor-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    margin-top: -8px;
}

/* Canvas */
.canvas-wrapper {
    position: relative;
    width: 100%;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    margin-bottom: 16px;
    touch-action: none;
}

.canvas-wrapper:active {
    cursor: grabbing;
}

.canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Zoom Control */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.zoom-label {
    font-size: 18px;
}

.zoom-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

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

.zoom-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: right;
}

/* Editor Actions */
.editor-actions {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Generate Button */
.calc-btn {
    width: 100%;
    padding: 16px;
    margin-bottom: 24px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-btn:hover {
    filter: brightness(1.1);
}

.calc-btn:active {
    transform: scale(0.98);
}

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

/* Error */
.error-card {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 16px;
    color: #c00;
    text-align: center;
    margin-bottom: 16px;
}

body.dark .error-card {
    background: #400;
    border-color: #600;
    color: #faa;
}

/* Footer */
.footer {
    flex-shrink: 0;
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

/* Responsive */
@media (max-width: 480px) {
    .title-section h1 {
        font-size: 14px;
    }
    
    .format-tab {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .mode-tab {
        padding: 12px 8px;
        font-size: 13px;
    }
}
