:root {
    --bg-primary: #050508;
    --bg-secondary: #0a0a10;
    --bg-tertiary: #111118;
    --bg-card: #0d0d14;
    --border-color: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #9090a0;
    --text-muted: #505060;
    --accent-primary: #f97316;
    --accent-secondary: #fb923c;
    --accent-glow: rgba(249, 115, 22, 0.3);
    --gradient-1: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #dc2626 100%);
    --success: #22c55e;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.usage-info {
    margin-bottom: 12px;
}

.usage-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.usage-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.usage-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.usage-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-upgrade {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Main Content */
.main {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    max-width: 900px;
}

.content-header {
    margin-bottom: 32px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Generator Card */
.generator-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.options-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

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

.option-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

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

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

.btn-generate {
    width: 100%;
    padding: 16px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-icon {
    font-size: 18px;
}

/* Output Section */
.output-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
}

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

.output-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.tweet-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.tweet-content {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.tweet-meta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.tweet-actions {
    display: flex;
    gap: 12px;
}

/* Thread Preview */
.thread-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.thread-tweet {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
}

.thread-tweet::before {
    content: '';
    position: absolute;
    left: 24px;
    top: -12px;
    width: 2px;
    height: 12px;
    background: var(--border-color);
}

.thread-tweet:first-child::before {
    display: none;
}

.thread-number {
    font-size: 11px;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.thread-text {
    font-size: 14px;
    line-height: 1.6;
}

/* Hooks Grid */
.hooks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.hook-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hook-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.hook-category {
    font-size: 11px;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.hook-template {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Saved List */
.saved-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.saved-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.saved-actions {
    display: flex;
    gap: 8px;
}

.saved-actions button {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.saved-actions button:hover {
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Settings Card */
.settings-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main {
        margin-left: 0;
        padding: 16px;
    }
    
    .options-row {
        grid-template-columns: 1fr;
    }
    
    .hooks-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.modal-header p {
    color: var(--text-secondary);
}

.auth-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #ef4444;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.btn-full {
    width: 100%;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: inherit;
    font-weight: 500;
}

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

.forgot-password {
    text-align: right;
    margin-bottom: 16px;
    margin-top: -8px;
}

.forgot-password .btn-link {
    font-size: 13px;
    color: var(--text-secondary);
}

.forgot-password .btn-link:hover {
    color: var(--accent-primary);
}

/* User info in sidebar */
.user-info {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.user-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    word-break: break-all;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-logout {
    width: 100%;
}

.auth-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-buttons .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

/* Upgrade Modal */
.modal-upgrade {
    max-width: 440px;
    text-align: center;
}

.upgrade-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upgrade-features {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}

.feature-item {
    padding: 10px 0;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.upgrade-price {
    margin: 24px 0;
}

.price-amount {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 18px;
    color: var(--text-secondary);
}

.btn-glow {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    to {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
    }
}

.upgrade-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Password toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

/* AI Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tool-card .tool-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.tool-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tool-card p {
    font-size: 13px;
    color: var(--text-secondary);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tool-active-icon {
    font-size: 24px;
}

.tool-header h3 {
    flex: 1;
    font-size: 18px;
}

/* History */
.history-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

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

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: var(--accent-primary);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--accent-primary);
    text-transform: uppercase;
    font-weight: 600;
}

.history-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.history-item-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Settings */
.settings-section {
    margin-bottom: 32px;
}

.settings-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.settings-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.export-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    cursor: pointer;
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.content-header {
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.content-header p {
    color: var(--text-secondary);
}

