:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding: 2rem;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

header h1 span {
    color: var(--primary);
    font-weight: 400;
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

.editor-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.controls-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.step-num {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

/* Form Elements */
label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

select, textarea, input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

textarea:focus, input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Color Palette */
.color-selector-panel {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, border 0.2s;
    border: 2px solid transparent;
}

.color-dot:hover {
    transform: scale(1.1);
    border-color: white;
}

/* Pixel Grid */
.pixel-grid {
    display: grid;
    gap: 3px;
    background: #000;
    padding: 10px;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    min-height: 50px;
}

.pixel {
    background: var(--pixel-bg-color, rgba(255, 255, 255, 0.1));
    aspect-ratio: 1 / 1;
    min-height: 20px;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pixel:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Buttons */
.pixel-actions, .action-buttons {
    display: flex;
    gap: 0.75rem;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button.secondary-mini {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    flex: 1;
}

#copy-full-sms {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Phone Preview */
.phone-frame {
    width: 320px;
    height: 600px;
    background: #000;
    border: 12px solid #222;
    border-radius: 3rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.phone-header {
    height: 40px;
    background: #111;
    display: flex;
    padding: 0 20px;
    align-items: center;
    font-size: 0.7rem;
    color: #666;
}

.phone-screen {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.message-bubble {
    background: #262626;
    padding: 12px;
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    font-size: 9px;
    line-height: 1.2;
}

.message-bubble pre {
    font-family: 'Courier New', monospace;
    white-space: pre;
    margin-bottom: 10px;
}

#final-preview-text {
    font-size: 14px;
    color: #e2e8f0;
    line-height: 1.5;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

/* Stats and Warnings */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-box {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 1rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.warning-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 1rem;
    color: #fbbf24;
    font-size: 0.8rem;
}

.style-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.style-btn {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    color: var(--text-muted);
}

.style-btn.active {
    background: var(--primary);
    color: white;
}
