/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0 60px;
    color: white;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 15px;
    opacity: 0.95;
}

.hero-description {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}

/* Card Styles */
.install-section,
.demo-section,
.usage-section,
.compatible-section {
    margin-bottom: 40px;
}

.install-card,
.demo-card,
.usage-card,
.compatible-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.install-card h2,
.demo-card h2,
.usage-card h2,
.compatible-card h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #1a202c;
    text-align: center;
}

.install-description {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #4a5568;
}

/* Install Methods */
.install-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.method-card {
    background: #f7fafc;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.method-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.method-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.method-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.method-card p {
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Bookmarklet Button */
.bookmarklet-btn {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
}

.bookmarklet-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.copy-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #3182ce;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #48bb78;
}

/* Copy Instructions */
.copy-instructions {
    margin-top: 20px;
    text-align: left;
}

.copy-instructions ol {
    padding-left: 20px;
}

.copy-instructions li {
    margin-bottom: 8px;
    color: #4a5568;
}

/* Bookmarklet Code Display */
.bookmarklet-code {
    background: #1a202c;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    font-family: 'Monaco', 'Menlo', monospace;
    overflow-x: auto;
}

.bookmarklet-code code {
    color: #68d391;
    font-size: 13px;
    word-break: break-all;
    white-space: pre-wrap;
}

.method-note {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 10px;
    font-style: italic;
}

/* Demo Controls */
.demo-controls {
    text-align: center;
    margin-bottom: 40px;
}

.demo-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 10px 10px 0;
    transition: all 0.3s ease;
}

.demo-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.demo-btn.primary {
    background: #48bb78;
}

.demo-btn.primary:hover {
    background: #38a169;
}

/* Personas Preview */
.personas-preview h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2d3748;
}

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

.persona-card {
    background: #f7fafc;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.persona-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.persona-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #e2e8f0;
}

.persona-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #2d3748;
}

.persona-info p {
    color: #4a5568;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.persona-focus {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Usage Steps */
.usage-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.step-number {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #2d3748;
}

.step-content p {
    color: #4a5568;
    line-height: 1.5;
}

/* Compatible Apps */
.compatible-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}

.compatible-item {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.compatible-item:hover {
    border-color: #667eea;
    transform: translateY(-3px);
}

.compatible-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Widget Styles (Demo) */
.ai-tutor-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid #e1e5e9;
    overflow: hidden;
    transform: translateY(-10px);
    opacity: 0;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: relative;
}

.widget-close,
.minimize-btn {
    position: absolute;
    top: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.2s;
}

.widget-close {
    right: 15px;
}

.minimize-btn {
    right: 50px;
    font-size: 14px;
}

.widget-close:hover,
.minimize-btn:hover {
    background: rgba(255,255,255,0.3);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.widget-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.connection-status {
    font-size: 11px;
    opacity: 0.8;
}

.persona-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.persona-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.persona-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.current-persona {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fafbfc;
}

.persona-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e1e5e9;
}

.persona-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.persona-info p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-left: auto;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fdfdfd;
}

.message {
    display: flex;
    gap: 8px;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-content {
    background: #f1f3f4;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.4;
    color: #1f2937;
}

.message.user .message-content {
    background: #667eea;
    color: white;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.chat-input {
    padding: 16px;
    border-top: 1px solid #e1e5e9;
    background: white;
}

.input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.input-field {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 13px;
    resize: none;
    min-height: 18px;
    max-height: 80px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    border-color: #667eea;
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.send-btn:hover {
    background: #5a67d8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .install-methods {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .usage-steps {
        grid-template-columns: 1fr;
    }
    
    .ai-tutor-widget {
        width: 95vw;
        height: 80vh;
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .install-card,
    .demo-card,
    .usage-card,
    .compatible-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0 30px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
}