:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-light: #f1f5f9;
    --text-muted: #cbd5e1;
    --border-color: #334155;
    --hover-bg: #1e293b;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Hero Section */
.hero {
    padding: 120px 0;
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.cta-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

/* Sections */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* PSI Section */
.psi-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.psi-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.psi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.psi-card:hover {
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-5px);
}

.psi-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.psi-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.psi-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.pain-points,
.benefits,
.features {
    list-style: none;
}

.pain-points li,
.benefits li,
.features li {
    padding: 0.5rem 0;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.pain-points li:last-child,
.benefits li:last-child,
.features li:last-child {
    border-bottom: none;
}

.benefits li::before {
    content: '✓ ';
    color: var(--success-color);
    font-weight: bold;
}

/* Scanner Section */
.scanner-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.scanner-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 500px;
    margin: 0 auto 2rem;
    background: var(--bg-darker);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.camera-container:hover {
    border-color: var(--primary-color);
}

#cameraFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

#cameraFeed.active {
    display: block;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
}

.focus-ring {
    width: 200px;
    height: 200px;
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    animation: pulse 2s infinite;
}

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

.camera-hint {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.scanner-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Preview Section */
.preview-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.preview-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.preview-image-container {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-info h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.info-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.info-value {
    display: block;
    color: var(--primary-color);
    font-weight: 600;
}

.preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .preview-wrapper {
        grid-template-columns: 1fr;
    }
    
    .preview-actions {
        grid-template-columns: 1fr;
    }
}

/* Results Section */
.results-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.results-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
    align-items: start;
}

.results-image {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
}

.result-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.analysis-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.analysis-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.result-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 3px solid var(--primary-color);
}

.result-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.classification-box {
    display: grid;
    gap: 1rem;
}

.class-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.class-label {
    color: var(--text-muted);
}

.class-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.confidence-bar {
    position: relative;
    height: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 1s ease-out;
}

.confidence-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

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

.feature-tag {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
}

.insights-text {
    color: var(--text-muted);
    line-height: 1.8;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    padding: 1rem;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.metadata-item {
    text-align: center;
}

.metadata-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.metadata-value {
    display: block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.status-success {
    color: var(--success-color);
}

.results-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .results-wrapper {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        grid-template-columns: 1fr;
    }
}

/* Demo Section */
.demo-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.demo-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.demo-card:hover {
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-5px);
}

.demo-image {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.demo-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.demo-card p {
    color: var(--text-muted);
}

/* Innovation Section */
.innovation-section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tech-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.tech-item:hover {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.05);
}

.tech-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tech-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tech-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background: rgba(2, 6, 23, 0.8);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .psi-grid {
        grid-template-columns: 1fr;
    }
    
    .scanner-controls {
        grid-template-columns: 1fr;
    }
    
    .scanner-wrapper {
        max-width: 100%;
    }
    
    .camera-container {
        height: auto;
        aspect-ratio: 1;
        max-width: 100%;
    }
    
    .demo-grid,
    .tech-stack {
        grid-template-columns: 1fr;
    }
}