:root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666666;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --border: #e5e5e5;
    --shadow: rgba(0, 0, 0, 0.1);
    --error: #ef4444;
    --success: #22c55e;
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --text: #f5f5f5;
    --text-secondary: #a0a0a0;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --border: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-icon {
    padding: 8px 12px;
    font-size: 1rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}

.home-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea::placeholder {
    color: var(--text-secondary);
}

.login-form, .register-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 350px;
    margin: 40px auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.messages-section {
    margin-top: 30px;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.messages-header h2 {
    font-size: 1.3rem;
}

.share-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.share-link code {
    color: var(--accent);
    word-break: break-all;
}

.copy-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.message-text {
    margin-bottom: 10px;
    line-height: 1.5;
}

.message-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.empty-messages {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.hidden {
    display: none;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}