:root {
    --bg-color: #fffbeb;
    --card-bg: #ffffff;
    --text-color: #1c1917;
    --text-muted: #44403c;
    --primary-color: #f59e0b;
    --primary-hover: #d97706;
    --success-color: #10b981;
    --border-color: #1c1917;
    --header-bg: rgba(255, 251, 235, 0.8);
    --shadow: 4px 4px 0px 0px #1c1917;
    --transition: all 0.2s ease;
}

body.dark-mode {
    --bg-color: #1c1917;
    --card-bg: #292524;
    --text-color: #fafaf9;
    --text-muted: #d6d3d1;
    --primary-color: #fbbf24;
    --primary-hover: #fcd34d;
    --border-color: #44403c;
    --header-bg: rgba(28, 25, 23, 0.8);
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    font-size: 1.75rem;
}

/* Buttons */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--border-color);
}

.sun-icon { display: none; }
body.dark-mode .sun-icon { display: block; }
body.dark-mode .moon-icon { display: none; }

/* Feature Tabs */
.feature-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
    background-color: var(--card-bg);
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}

.tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

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

/* Cards & Forms */
.card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 2px 2px 0px 0px var(--primary-color);
}

textarea.form-control {
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--border-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px 0px var(--border-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

/* Previews Grid */
.previews-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .previews-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.preview-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
}

.platform-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    box-shadow: var(--shadow);
}

.platform-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.platform-header {
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
}

.platform-name {
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.limit-indicator {
    font-size: 0.75rem;
    font-weight: 600;
}

.limit-warning { color: #f59e0b; }
.limit-danger { color: #ef4444; }

.preview-body {
    padding: 1rem;
    flex-grow: 1;
    font-size: 0.9375rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.platform-actions {
    padding: 0.75rem;
    background-color: var(--card-bg);
    display: flex;
    gap: 0.5rem;
    border-top: 2px solid var(--border-color);
}

/* Image Tool */
.canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-color: #000;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.canvas-hint {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    pointer-events: none;
}

/* Footer */
.app-footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Animations */
@keyframes bounceIn {
    0% { transform: scale(0.9); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.platform-card {
    animation: bounceIn 0.5s ease-out backwards;
}

.platform-card:nth-child(1) { animation-delay: 0.1s; }
.platform-card:nth-child(2) { animation-delay: 0.2s; }
.platform-card:nth-child(3) { animation-delay: 0.3s; }
.platform-card:nth-child(4) { animation-delay: 0.4s; }
.platform-card:nth-child(5) { animation-delay: 0.5s; }
.platform-card:nth-child(6) { animation-delay: 0.6s; }

