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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --brightness: 1;
}

[data-theme="dark"] {
    --bg: #111827;
    --bg-secondary: #1f2937;
    --text: #f9fafb;
    --text-secondary: #9ca3af;
    --border: #374151;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    filter: brightness(var(--brightness));
}

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

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

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

.nav {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.lang-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

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

.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.main {
    padding: 60px 0;
}

.hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero h2 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.input-group {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.input-field {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    cursor: pointer;
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

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

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
}

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
    transition: transform 0.2s;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--secondary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 500px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.chat-window.hidden {
    display: none;
}

.chat-header {
    padding: 16px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    font-size: 16px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.message {
    margin-bottom: 12px;
    display: flex;
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--bg-secondary);
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--primary);
    color: white;
}

.chat-input {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.chat-input .input-field {
    flex: 1;
    padding: 10px 16px;
}

.chat-input .btn-primary {
    padding: 10px 16px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

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

.modal-content h3 {
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-social {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

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

.btn-social span {
    font-weight: 700;
}

.btn-google span {
    color: #4285f4;
}

.btn-microsoft span {
    color: #00a4ef;
}

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.divider span {
    background: var(--bg);
    padding: 0 16px;
    color: var(--text-secondary);
    position: relative;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-block {
    width: 100%;
}

.demo-accounts {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.page-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1500;
    overflow-y: auto;
    padding: 20px;
}

.page-container.hidden {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 32px;
    font-weight: 700;
}

.btn-back {
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

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

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

.generator-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    min-height: 200px;
}

.platform-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.platform-option {
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.platform-option:hover {
    border-color: var(--primary);
}

.platform-option.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.qr-container {
    text-align: center;
    padding: 40px;
}

.qr-code {
    width: 256px;
    height: 256px;
    margin: 24px auto;
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.dashboard-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.dashboard-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.chart-placeholder {
    height: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.pricing-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.pricing-card.featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
}

.pricing-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    margin: 16px 0;
}

.pricing-price span {
    font-size: 16px;
    color: var(--text-secondary);
}

.pricing-features {
    list-style: none;
    margin: 24px 0;
    text-align: left;
}

.pricing-features li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.pricing-features li:before {
    content: "✓ ";
    color: var(--primary);
    font-weight: 700;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.payment-method {
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.payment-method:hover {
    border-color: var(--primary);
}

.payment-method.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.legal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    line-height: 1.8;
}

.legal-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
}

.legal-content p {
    margin-bottom: 16px;
}

.admin-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.admin-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .chat-window {
        width: calc(100vw - 48px);
        right: 24px;
    }
    
    .header .container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav {
        justify-content: center;
    }
}
