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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
    opacity: 0.3;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
    line-height: 1.8;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Interactive Demo */
.interactive-demo {
    position: relative;
}

.demo-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.question-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    font-family: inherit;
}

.question-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ball-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    margin: 20px 0;
}

.magic-ball {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 35% 35%, #2a2a2a, #000000);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 
        inset -8px -8px 20px rgba(0, 0, 0, 0.8),
        inset 8px 8px 20px rgba(255, 255, 255, 0.1),
        0 15px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.magic-ball:hover {
    transform: scale(1.05);
}

.ball-shine {
    position: absolute;
    top: 30px;
    left: 50px;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 50%;
    filter: blur(8px);
}

.answer-display {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #1e40af, #1e3a8a);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    padding: 15px;
    box-shadow: 
        inset 0 -4px 8px rgba(0, 0, 0, 0.5),
        inset 0 4px 8px rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.number {
    font-size: 3rem;
    font-weight: 800;
    font-family: Arial, sans-serif;
}

.answer-text {
    display: block;
    line-height: 1.3;
    font-size: 0.95rem;
    animation: fadeIn 0.5s ease;
}

.loading {
    font-size: 2rem;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.shake-animation {
    animation: shake 0.6s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px) rotate(-3deg); }
    20%, 40%, 60%, 80% { transform: translateX(8px) rotate(3deg); }
}

.shaking {
    animation: vibrate 0.2s ease infinite;
}

@keyframes vibrate {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-1deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

/* Buttons */
.btn {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: #ef4444;
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Locale Selector */
.locale-selector {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.locale-selector label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.locale-select {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    background: white;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.locale-select:focus {
    border-color: var(--primary-color);
}

/* Examples Section */
.examples-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 60px;
    color: var(--text-primary);
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.example-card {
    padding: 30px;
    background: var(--bg-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.example-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.example-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.example-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* API Section */
.api-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.api-endpoints {
    display: grid;
    gap: 20px;
    margin-bottom: 60px;
}

.endpoint-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.endpoint-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.method {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.method.get {
    background: #10b981;
    color: white;
}

.method.post {
    background: #f59e0b;
    color: white;
}

.endpoint-card code {
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.endpoint-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Quick Start */
.quick-start {
    background: white;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.quick-start h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.steps {
    display: grid;
    gap: 24px;
}

.step {
    display: flex;
    gap: 20px;
    align-items: start;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.step-interactive:hover {
    background: var(--bg-light);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step-content code {
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 12px;
    word-break: break-all;
}

.api-url {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.api-response {
    color: #10b981 !important;
    font-weight: 600;
}

.btn-try {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    margin-top: 8px;
}

.btn-try:hover {
    background: var(--primary-dark);
    transform: translateX(5px);
}

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

.step-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.step-result.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.step-result.success {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.step-result.loading {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.step-result.error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.step-result pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 8px;
    font-size: 0.85rem;
}

/* History Section */
.history-section {
    padding: 80px 0;
    background: white;
}

.history-container {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.history-container::-webkit-scrollbar {
    width: 8px;
}

.history-container::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.history-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.no-history {
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 20px;
    font-size: 1.1rem;
}

.history-item {
    background: white;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    animation: slideIn 0.3s ease;
    transition: all 0.2s ease;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

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

.history-number {
    background: var(--primary-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-question {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.history-answer {
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.history-timestamp {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    font-size: 3rem;
}

.footer-brand p {
    font-size: 1.2rem;
    font-weight: 700;
}

.footer-copy {
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 400 !important;
}

.footer-links h4 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-subtitle {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .magic-ball {
        width: 180px;
        height: 180px;
    }

    .answer-display {
        width: 80px;
        height: 80px;
    }

    .number {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 1.75rem;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

.title {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.5);
    }
    to {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.8);
    }
}

.question-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.question-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #667eea;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

.question-input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

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

.btn-ask:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.ball-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.magic-ball {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 30% 30%, #333, #000);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 
        inset -10px -10px 30px rgba(0, 0, 0, 0.8),
        inset 10px 10px 30px rgba(255, 255, 255, 0.1),
        0 20px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.ball-shine {
    position: absolute;
    top: 40px;
    left: 60px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 50%;
    filter: blur(10px);
}

.answer-display {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #1e3a8a, #1e40af);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    box-shadow: 
        inset 0 -5px 10px rgba(0, 0, 0, 0.5),
        inset 0 5px 10px rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.number {
    font-size: 4rem;
    font-weight: bold;
    font-family: 'Arial Black', sans-serif;
}

.answer-text {
    display: block;
    line-height: 1.4;
    animation: fadeIn 0.5s ease;
}

.loading {
    font-size: 3rem;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.shake-animation {
    animation: shake 0.6s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px) rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: translateX(10px) rotate(5deg); }
}

.shaking {
    animation: vibrate 0.3s ease infinite;
}

@keyframes vibrate {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px) rotate(-1deg); }
    75% { transform: translateX(2px) rotate(1deg); }
}

.history-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.history-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2rem;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.language-selector label {
    font-weight: bold;
    color: #667eea;
}

.locale-select {
    padding: 8px 15px;
    font-size: 1rem;
    border: 2px solid #667eea;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    background: white;
}

.history-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
}

.history-container::-webkit-scrollbar {
    width: 8px;
}

.history-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.history-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.history-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
}

.history-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    animation: slideIn 0.3s ease;
    transition: transform 0.2s ease;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

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

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

.history-content {
    flex: 1;
}

.history-question {
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.history-answer {
    color: #667eea;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.history-timestamp {
    color: #999;
    font-size: 0.85rem;
}

.btn-clear {
    background: #dc3545;
    color: white;
    width: 100%;
}

.btn-clear:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.error {
    color: #dc3545;
    font-size: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .magic-ball {
        width: 250px;
        height: 250px;
    }

    .answer-display {
        width: 100px;
        height: 100px;
        font-size: 1rem;
    }

    .number {
        font-size: 3rem;
    }

    .input-container {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
    }
}
