:root {
    --bg-color: #f0f9ff;
    --sidebar-bg: rgba(255, 255, 255, 0.9);
    --card-bg: rgba(255, 255, 255, 0.5);
    --border-color: rgba(0, 150, 255, 0.1);
    --text-primary: #1a365d;
    --text-secondary: #64748b;
    
    --theme-sky: #0ea5e9;
    --theme-coral: #fb7185;
    --theme-mint: #2dd4bf;
    --theme-lemon: #fbbf24;
    
    --accent: var(--theme-sky);
    --accent-glow: rgba(14, 165, 233, 0.2);
    
    --sidebar-width: 400px;
}

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

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Floating Support Buttons */
.support-actions {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 50;
}

.action-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 10px 25px rgba(0, 100, 255, 0.1);
    transition: all 0.3s;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 100, 255, 0.2);
}

.action-btn.thanks { color: #fb7185; }
.action-btn.support { color: #0369a1; }

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 10px 0 30px rgba(0, 100, 255, 0.05);
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom right, rgba(255,255,255,0.8), rgba(224, 242, 254, 0.5));
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #0c4a6e;
}

.logo .v2 {
    color: var(--accent);
    font-style: normal;
    background: linear-gradient(135deg, #0ea5e9, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.scroll-area::-webkit-scrollbar {
    width: 6px;
}

.scroll-area::-webkit-scrollbar-thumb {
    background: rgba(0, 150, 255, 0.1);
    border-radius: 10px;
}

.config-section {
    margin-bottom: 2.5rem;
}

.config-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
}

/* Theme Selector */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.theme-card {
    background: white;
    border: 2px solid transparent;
    padding: 0.8rem;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.theme-card.active {
    border-color: var(--accent);
    background: white;
}

.theme-card input {
    display: none;
}

.theme-preview {
    width: 24px;
    height: 24px;
    border-radius: 8px;
}

.theme-preview.cyan { background: var(--theme-sky); }
.theme-preview.magenta { background: var(--theme-coral); }
.theme-preview.gold { background: var(--theme-lemon); }
.theme-preview.emerald { background: var(--theme-mint); }

.theme-card span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
}

/* Inputs */
.input-group {
    margin-bottom: 1.2rem;
}

.row {
    display: flex;
    gap: 1rem;
}

.row .input-group {
    flex: 1;
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
    margin-left: 0.2rem;
}

input[type="text"], select, textarea {
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s;
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Buttons */
.upload-buttons {
    display: flex;
    gap: 0.8rem;
}

.upload-btn {
    flex: 1;
    background: white;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 1rem;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: #f8fafc;
    border-color: var(--accent);
    color: var(--accent);
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(14, 165, 233, 0.3);
}

.secondary-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.status-msg {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #0ea5e9;
    text-align: center;
    min-height: 1.2rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

/* Tags */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag input { display: none; }

.tag span {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.tag input:checked + span {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
    font-weight: 600;
}

/* Character Slots */
.char-slots {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.slot-group label {
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
    color: #94a3b8;
}

.slots-row {
    display: flex;
    gap: 1rem;
}

.char-slot {
    width: 80px;
    height: 80px;
    background: white;
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.char-slot:hover {
    border-color: var(--accent);
    background: #f0f9ff;
    transform: scale(1.05);
}

.char-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Preview Area */
.preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    position: relative;
    padding: 2rem;
}

.canvas-wrapper {
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 100, 255, 0.1);
    border-radius: 32px;
    overflow: hidden;
    max-width: 90%;
    max-height: 90%;
    background: white;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.canvas-overlay {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0369a1;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 700px;
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.search-bar {
    flex: 1;
    margin: 0 2rem;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    width: 18px;
}

.search-bar input {
    padding-left: 3rem;
}

.close-btn {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1.2rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.char-item {
    background: #f8fafc;
    border-radius: 20px;
    padding: 1.2rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.char-item:hover {
    background: #e0f2fe;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 100, 255, 0.1);
}

.char-item img {
    width: 70px;
    height: 70px;
    border-radius: 24px;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    object-fit: cover;
}

.char-item span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    word-break: keep-all;
    line-height: 1.2;
}

/* Support & Thanks Modals */
.support-body {
    text-align: center;
    padding: 1rem 0;
}

.qr-container {
    margin: 2rem auto;
    width: 240px;
    height: 240px;
    background: white;
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-container img {
    max-width: 100%;
    height: auto;
}

.upload-btn-sm {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.upload-btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.sponsor-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 20px;
}

.sponsor-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.sponsor-item:last-child { border-bottom: none; }
.sponsor-name { font-weight: 700; color: #1e293b; }
.sponsor-date { color: #64748b; font-size: 0.8rem; }

/* Enhanced Crop Modal */
.crop-modal-content {
    max-width: 800px;
}

.crop-container {
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 2rem;
    max-height: 50vh;
}

.crop-container img {
    max-width: 100%;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { display: none; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider { background-color: #0ea5e9; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.effect-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-top: 1.2rem;
    background: #f8fafc;
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
}
