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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0A0A0A;
    color: #ffffff;
    position: relative;
    
    /* Lock height and prevent scroll on large screens for the 'full screen' effect */
    height: 100vh;
    overflow: hidden;
}

/* On screens smaller than 1200px, allow the body to grow and enable scrolling */
@media (max-width: 1199px) {
    body {
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Background Effects */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    bottom: -150px;
    left: -150px;
    animation-delay: -10s;
    opacity: 0.3;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: 50%;
    left: 20%;
    animation-delay: -5s;
    opacity: 0.2;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Stars Background */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    border-radius: 50%;
    animation: sparkle 3s ease-in-out infinite;
    filter: blur(0.5px);
}

.star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.star::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 200%;
    background: linear-gradient(0deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.star:nth-child(odd) {
    animation-delay: 0s;
}

.star:nth-child(even) {
    animation-delay: 1.5s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
        box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
        filter: blur(0.5px);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3);
        box-shadow: 0 0 16px rgba(255, 255, 255, 0.9), 0 0 8px rgba(255, 255, 255, 0.7);
        filter: blur(0.2px);
    }
}

.star:hover::before,
.star:hover::after {
    opacity: 0.6;
}

/* Header */
.header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.logo svg {
    width: 20px;
    height: 20px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #667eea;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3rem;
    
    min-height: calc(100vh - 80px);
}


.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1400px;
    width: 100%;
    align-items: center;
}

/* Hero Text */
.hero-text {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: #ffffff;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    max-width: 550px;
}

/* Feature Pills */
.feature-pills {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.pill-icon {
    font-size: 1rem;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Mockup Container */
.mockup-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.browser-mockup {
    width: 500px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: mockupFloat 6s ease-in-out infinite;
    max-width: 100%;
}

@keyframes mockupFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.browser-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.browser-controls {
    display: flex;
    gap: 0.5rem;
    margin-right: 1rem;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red { background: #FF5F57; }
.control.yellow { background: #FFBD2E; }
.control.green { background: #28CA42; }

.browser-url {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    flex: 1;
}

.browser-content {
    padding: 1.5rem;
    position: relative;
    height: 400px;
    overflow: hidden;
}

/* Chat Interface */
.chat-container {
    margin-bottom: 1.5rem;
}

.chat-message {
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out;
}

.chat-message.ai-message {
    transition: opacity 0.3s ease;
}

.message-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
}

.user-message .message-content {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    margin-left: 2rem;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    margin-bottom: 1rem;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: typing-pulse 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-pulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Typing Cursor */
.typing-cursor {
    display: none;
    animation: cursor-blink 1s infinite;
    color: rgba(255, 255, 255, 0.8);
    font-weight: normal;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Extension UI */
.extension-ui {
    position: absolute;
    bottom: 1.5rem;
    right: 1rem;
    width: 140px;
    min-width: 120px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 10px 12px;
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateX(20px) scale(0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(102, 126, 234, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", Roboto, sans-serif;
    font-size: 12px;
    user-select: none;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    cursor: default;
    pointer-events: auto;
    visibility: visible;
    transform-origin: bottom right;
}

@keyframes extensionSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.extension-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.extension-logo {
    width: 12px;
    height: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-right: 6px;
}

.extension-logo svg {
    width: 100%;
    height: 100%;
}

.extension-title {
    font-weight: 600;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0.7;
}

.token-stats {
    text-align: center;
    margin: 4px 0 6px 0;
    user-select: none;
    font-weight: 500;
    line-height: 1.2;
    color: #ffffff;
}

.token-counts {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 1px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.token-percentage {
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.meter-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.meter-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    width: 0%;
    transition: all 0.4s ease;
}

@keyframes fillAnimation {
    to { width: 2.1%; }
}

/* Demo Button Styles */
.demo-link {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem auto 1.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    width: fit-content;
    position: relative;
    z-index: 1;
}

.demo-link::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: inherit;
    z-index: -2;
}

.demo-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #0A0A0A;
    border-radius: inherit;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.demo-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.demo-link:hover::after {
    opacity: 0;
}

.demo-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    fill: currentColor;
}

.demo-link:hover .demo-icon {
    transform: scale(1.1);
}

/* Demo Modal Styles */
.demo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.demo-modal.active {
    display: flex;
}

.demo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.demo-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.demo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
}

.demo-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.demo-modal-close svg {
    width: 20px;
    height: 20px;
}

.demo-modal-body {
    padding: 1.5rem;
}

.modal-mockup {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.modal-mockup .browser-content {
    height: 500px;
    padding: 1.5rem;
}

.modal-mockup .extension-ui {
    transform: none;
    scale: 1;
    opacity: 0;
}

.modal-mockup #modal-typing-indicator {
    display: block;
    opacity: 0;
}

/* Modal responsive adjustments */
@media (max-width: 600px) {
    .demo-modal-content {
        max-width: 95vw;
        max-height: 90vh;
        margin: 0;
    }
    
    .demo-modal-header {
        padding: 1rem;
    }
    
    .demo-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .demo-modal-body {
        padding: 1rem;
    }
    
    .modal-mockup .browser-content {
        height: 420px;
        padding: 1rem;
    }
    
    .modal-mockup .extension-ui {
        transform: scale(0.9);
        right: 0.5rem;
        bottom: 1rem;
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .demo-modal-content {
        max-width: 98vw;
        max-height: 85vh;
        border-radius: 12px;
    }
    
    .demo-modal-header {
        padding: 0.75rem;
    }
    
    .demo-modal-body {
        padding: 0.75rem;
    }
    
    .modal-mockup .browser-content {
        height: 380px;
        padding: 0.75rem;
    }
    
    .modal-mockup .chat-message .message-content {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    .modal-mockup .extension-ui {
        transform: scale(0.75);
        right: 0.5rem;
        bottom: 0.75rem;
        opacity: 0;
    }
}

@media (max-width: 400px) {
    .modal-mockup .browser-content {
        height: 400px;
    }
    
    .modal-mockup .extension-ui {
        transform: scale(0.7);
        right: 0.3rem;
        bottom: 1rem;
    }
    
    .modal-mockup .chat-message .message-content {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}


/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1199px) {
    .main-content {
        padding: 4rem 3rem;
        align-items: flex-start;
    }

    .hero-section {
        grid-template-columns: 1fr;
        gap: 2rem; /* Adjusted gap for mobile */
        text-align: center;
        width: 100%;
    }
    
    /* --- KEY CHANGE --- */
    /* Make .hero-text container "disappear" and its children become direct grid items */
    .hero-text {
        display: contents; 
    }

    /* Then, we can order all direct items of .hero-section */
    .hero-title { order: 1; }
    .hero-subtitle { order: 2; margin: 0 auto; }
    .mockup-container { order: 3; margin-top: 1.5rem; } /* Add margin-top for spacing */
    .feature-pills { order: 4; justify-content: center; margin-top: 1.5rem; }
    .cta-buttons { order: 5; justify-content: center; }


    .browser-mockup {
        width: 100%;
        max-width: 550px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem 1.5rem;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .main-content {
        padding: 2.5rem 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .browser-content {
        height: 350px;
        padding: 1rem;
    }

    .extension-ui {
        transform: scale(0.9);
    }
}

@media (max-width: 600px) {
    /* Hide mockup container on small screens */
    .mockup-container {
        display: none;
    }
    
    /* Show demo link on small screens */
    .demo-link {
        display: flex;
        justify-content: center;
    }
    
    /* Force feature pills to column layout */
    .feature-pills {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }
    
    .brand-name {
        font-size: 1.25rem;
    }
    
    .feature-pills {
        flex-direction: column;
        align-items: center;
    }
    
    .browser-content {
        height: 300px;
        padding: 0.75rem;
    }
    
    .extension-ui {
        transform: scale(0.85);
        right: 0.5rem;
        bottom: 1rem;
    }
}