/* CSS Variables for theming */
:root {
    --bg-color: #000000;
    --text-color: #E0E0E0;
    --header-nav-color: #9ca3af;
    --header-nav-hover-color: #FFFFFF;
    --card-bg: rgba(26, 18, 38, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-placeholder-color: #9ca3af;
    --ai-chat-bg: #374151;
    --user-chat-bg: #4f46e5;
}

/* Light Mode Variables */
body.light-mode {
    --bg-color: #F3F4F6;
    /* Light gray */
    --text-color: #1F2937;
    /* Darker text */
    --header-nav-color: #4B5563;
    --header-nav-hover-color: #1F2937;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.15);
    --input-placeholder-color: #6B7280;
    --ai-chat-bg: #E5E7EB;
    --user-chat-bg: #6366F1;
    /* Indigo-500 */
}

/* Base styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    /* Prevents horizontal scroll from glow effects */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Main container */
.main-container {
    max-width: 56rem;
    /* max-w-4xl */
    margin-left: auto;
    /* mx-auto */
    margin-right: auto;
    /* mx-auto */
    padding-left: 1rem;
    /* px-4 */
    padding-right: 1rem;
    /* px-4 */
    padding-top: 2rem;
    /* py-8 */
    padding-bottom: 2rem;
    /* py-8 */
    position: relative;
    /* relative */
    min-height: 100vh;
    overflow: hidden;
    /* overflow-hidden */
}

/* Responsive padding for main container */
@media (min-width: 640px) {

    /* sm breakpoint */
    .main-container {
        padding-left: 1.5rem;
        /* sm:px-6 */
        padding-right: 1.5rem;
        /* sm:px-6 */
    }
}

@media (min-width: 1024px) {

    /* lg breakpoint */
    .main-container {
        padding-left: 2rem;
        /* lg:px-8 */
        padding-right: 2rem;
        /* lg:px-8 */
    }
}

/* Header styles */
.header {
    display: flex;
    /* flex */
    justify-content: space-between;
    /* justify-between */
    align-items: center;
    /* items-center */
    margin-bottom: 3rem;
    /* mb-12 */
}

.header-logo {
    font-size: 1.5rem;
    /* text-2xl */
    font-weight: 700;
    /* font-bold */
    letter-spacing: 0.05em;
    /* tracking-wider */
}

.header-logo .ai-text {
    color: var(--text-color);
    /* text-white */
}

.header-logo .leaning-tool-text {
    color: #a78bfa;
    /* text-purple-400 */
}

.header-nav {
    display: none;
    /* hidden */
    gap: 2rem;
    /* space-x-8 */
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 500;
    /* font-medium */
    color: var(--header-nav-color);
    /* text-gray-400 */
}

.header-nav a {
    transition: color 0.3s ease;
    /* transition-colors */
}

.header-nav a:hover {
    color: var(--header-nav-hover-color);
    /* hover:text-white */
}

@media (min-width: 200px) {

    /* md breakpoint */
    .header-nav {
        display: flex;
        /* md:flex */
    }
    .header-nav{
        gap: 0.1;
        font-size: 0.0rem;
        font-family: 'Courier New', Courier, monospace;
        
    }
}

/* Mode Toggle Button */
.mode-toggle-button {
    background: none;
    border: 1px solid var(--header-nav-color);
    color: var(--header-nav-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-toggle-button:hover {
    background-color: var(--header-nav-color);
    color: var(--bg-color);
}

body.light-mode .mode-toggle-button {
    border-color: var(--text-color);
    color: var(--text-color);
}

body.light-mode .mode-toggle-button:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}


/* Hero Section */
.hero-section {
    text-align: center;
    /* text-center */
    margin-top: 6rem;
    /* my-24 */
    margin-bottom: 6rem;
    /* my-24 */
    position: relative;
    /* relative */
}

.hero-title {
    font-size: 5rem;
    /* text-5xl */
    font-weight: 800;
    /* font-extrabold */
    letter-spacing: -0.05em;
    /* tracking-tight */
    margin-bottom: 2rem;
    /* mb-8 */
    line-height: 1.25;
    /* leading-tight */
    background-image: linear-gradient(to right, #e5e7eb, #9ca3af);
    /* bg-gradient-to-r from-gray-200 to-gray-400 */
    -webkit-background-clip: text;
    /* bg-clip-text */
    background-clip: text;
    /* bg-clip-text */
    color: transparent;
    /* text-transparent */
}
@media(max-width:768px)
{
    .hero-title{
        font-size: 3rem;
        font-weight: 550;
        letter-spacing: -0.03em;
        margin-top: 4rem;
    }
}

/* Language and Role Selectors */
.select-wrapper {
    margin-bottom: 1rem;
    /* mb-4 */
    max-width: 12rem;
    /* max-w-xs */
    margin-left: auto;
    /* mx-auto */
    margin-right: auto;
    /* mx-auto */
}

.select-label {
    display: block;
    /* block */
    color: var(--text-color);
    /* text-gray-300 */
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 700;
    /* font-bold */
    margin-bottom: 0.5rem;
    /* mb-2 */
}

/* Mic Button Container */
.mic-button-container {
    display: flex;
    /* flex */
    justify-content: center;
    /* justify-center */
    align-items: center;
    /* items-center */
    margin-top: 4rem;
    /* my-16 */
    margin-bottom: 4rem;
    /* my-16 */
}

/* Voice Output Text */
.voice-output-text {
    font-size: 1.125rem;
    /* text-lg */
    color: var(--text-color);
    /* text-gray-300 */
    margin-top: 1rem;
    /* mt-4 */
    min-height: 30px;
    /* min-h-[30px] */
}

/* Why Choose Section */
.why-choose-section {
    margin-top: 6rem;
    /* my-24 */
    margin-bottom: 6rem;
    /* my-24 */
    position: relative;
    /* relative */
    overflow: hidden;
    /* overflow-hidden */
    border-radius: 1rem;
    /* rounded-2xl */
}

.why-choose-title {
    font-size: 2.25rem;
    /* text-4xl */
    font-weight: 700;
    /* font-bold */
    text-align: center;
    /* text-center */
    margin-bottom: 3rem;
    /* mb-12 */
}

.why-choose-grid {
    display: grid;
    /* grid */
    grid-template-columns: 1fr;
    /* grid-cols-1 */
    gap: 1.5rem;
    /* gap-6 */
}

@media (min-width: 768px) {

    /* md breakpoint */
    .why-choose-grid {
        grid-template-columns: 1fr 1fr;
        /* md:grid-cols-2 */
    }
}

/* Tense Guide / Image Understanding / Conversational Chat Sections */
.feature-section {
    margin-top: 6rem;
    /* my-24 */
    margin-bottom: 6rem;
    /* my-24 */
    position: relative;
    /* relative */
    overflow: hidden;
    /* overflow-hidden */
    border-radius: 1rem;
    /* rounded-2xl */
}

.feature-title {
    font-size: 2.25rem;
    /* text-4xl */
    font-weight: 700;
    /* font-bold */
    text-align: center;
    /* text-center */
    margin-bottom: 3rem;
    /* mb-12 */
}

.feature-content-wrapper {
    display: flex;
    /* flex */
    flex-direction: column;
    /* flex-col */
    gap: 1.5rem;
    /* space-y-6 */
    max-width: 42rem;
    /* max-w-2xl */
    margin-left: auto;
    /* mx-auto */
    margin-right: auto;
    /* mx-auto */
}

/* How it Works Section */
.how-it-works-section {
    margin-top: 6rem;
    /* my-24 */
    margin-bottom: 6rem;
    /* my-24 */
}

.how-it-works-title {
    font-size: 2.25rem;
    /* text-4xl */
    font-weight: 700;
    /* font-bold */
    text-align: center;
    /* text-center */
    margin-bottom: 3rem;
    /* mb-12 */
}

.how-it-works-video-wrapper {
    position: relative;
    /* relative */
    border-radius: 1rem;
    /* rounded-2xl */
    overflow: hidden;
    /* overflow-hidden */
    padding: 0.5rem;
    /* p-2 */
}

.how-it-works-video-overlay {
    position: absolute;
    /* absolute */
    inset: 0;
    /* inset-0 */
    display: flex;
    /* flex */
    align-items: center;
    /* items-center */
    justify-content: center;
    /* justify-center */
    background-color: rgba(0, 0, 0, 0.3);
    /* bg-black bg-opacity-30 */
}

.play-button {
    width: 5rem;
    /* w-20 */
    height: 5rem;
    /* h-20 */
    border-radius: 9999px;
    /* rounded-full */
    display: flex;
    /* flex */
    align-items: center;
    /* items-center */
    justify-content: center;
    /* justify-center */
    background-color: rgba(255, 255, 255, 0.2);
    /* bg-white bg-opacity-20 */
    backdrop-filter: blur(4px);
    /* backdrop-blur-sm */
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* border border-white/20 */
    transition: background-color 0.3s ease;
    /* transition-all */
    cursor: pointer;
}

.play-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    /* hover:bg-opacity-30 */
}

.play-button svg {
    height: 2.5rem;
    /* h-10 */
    width: 2.5rem;
    /* w-10 */
    color: #FFFFFF;
    /* text-white */
    margin-left: 0.25rem;
    /* ml-1 */
}

/* Footer */
.footer {
    text-align: center;
    /* text-center */
    color: var(--header-nav-color);
    /* text-gray-500 */
    font-size: 0.875rem;
    /* text-sm */
    margin-top: 6rem;
    /* mt-24 */
    padding-bottom: 2rem;
    /* pb-8 */
}

/* Custom styles for advanced effects (retained from original) */
.glass-card {
    background: var(--card-bg);
    /* Semi-transparent purple-ish background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    /* p-6 */
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.glass-card.feature-item {
    display: flex;
    /* flex */
    justify-content: space-between;
    /* justify-between */
    align-items: center;
    /* items-center */
}

.glass-card.feature-item h3 {
    font-size: 1.25rem;
    /* text-xl */
    font-weight: 600;
    /* font-semibold */
}

.mic-button {
    position: relative;
    z-index: 10;
    background: linear-gradient(145deg, #a955f7, #7a3bda);
    box-shadow: 0 0 15px #a955f7, 0 0 30px #a955f7, inset 0 0 5px rgba(255, 255, 255, 0.5);
    width: 6rem;
    /* w-24 */
    height: 6rem;
    /* h-24 */
    border-radius: 9999px;
    /* rounded-full */
    display: flex;
    /* flex */
    align-items: center;
    /* items-center */
    justify-content: center;
    /* justify-center */
    cursor: pointer;
}

.mic-button svg {
    height: 2.5rem;
    /* h-10 */
    width: 2.5rem;
    /* w-10 */
    color: #FFFFFF;
    /* text-white */
}

.aurora-glow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    /* Make it non-interactive */
}

.aurora-glow-1 {
    top: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(196, 99, 243, 0.3) 0%, rgba(196, 99, 243, 0) 60%);
    filter: blur(50px);
}

.aurora-glow-2 {
    top: -80px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(220, 50, 150, 0.2) 0%, rgba(220, 50, 150, 0) 70%);
    filter: blur(30px);
}

/* Animation for the microphone pulse */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px #a955f7, 0 0 30px #a955f7;
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px #c88cff, 0 0 50px #c88cff;
    }
}

.mic-pulse {
    animation: pulse 2.5s infinite ease-in-out;
}

.feature-icon {
    background-color: #a955f7;
    box-shadow: 0 0 8px #a955f7;
    width: 1rem;
    /* w-4 */
    height: 1rem;
    /* h-4 */
    border-radius: 9999px;
    /* rounded-full */
}

.feature-icon.small {
    width: 0.75rem;
    /* w-3 */
    height: 0.75rem;
    /* h-3 */
}

.ai-response-area {
    min-height: 100px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: left;
    overflow-y: auto;
    max-height: 300px;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.ai-response-area p.placeholder {
    color: var(--input-placeholder-color);
    /* text-gray-400 */
}

.ai-response-area p.content {
    color: var(--text-color);
    /* text-white */
    margin-top: 0.5rem;
    /* mt-2 */
}

.input-field {
    width: 100%;
    padding: 0.75rem;
    /* p-3 */
    border-radius: 0.75rem;
    /* rounded-xl */
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    font-size: 1rem;
    /* text-base */
    box-sizing: border-box;
    resize: vertical;
    transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease;
   
}

.input-field::placeholder {
    color: var(--input-placeholder-color);
    /* gray-400 */
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #a955f7;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.image-preview {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 0.75rem;
    margin-top: 1rem;
    border: 1px solid var(--card-border);
}

.action-buttons-group {
    display: flex;
    /* flex */
    justify-content: flex-start;
    /* justify-start */
    margin-top: 1rem;
    /* mt-4 */
}

.action-button {
    background-color: #6d28d9;
    /* violet-700 */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    margin-right: 0.5rem;
    /* Space between buttons */
    border: none;
    /* Remove default button border */
}

.action-button:hover {
    background-color: #5b21b6;
    /* violet-800 */
}

.stop-button {
    background-color: #dc2626;
    /* red-600 */
}

.stop-button:hover {
    background-color: #b91c1c;
    /* red-700 */
}

.delete-button {
    background-color: #f59e0b;
    /* amber-500 */
}

.delete-button:hover {
    background-color: #d97706;
    /* amber-600 */
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat specific styles */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* gap-3 */
    padding: 1rem;
    /* p-4 */
    border-radius: 1rem;
    /* rounded-xl */
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

.chat-message {
    padding: 0.75rem 1rem;
    /* py-3 px-4 */
    border-radius: 0.75rem;
    /* rounded-xl */
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.user {
    background-color: var(--user-chat-bg);
    /* indigo-600 */
    align-self: flex-end;
    /* align-self-end */
    margin-left: auto;
    /* ml-auto */
}

.chat-message.ai {
    background-color: var(--ai-chat-bg);
    /* gray-700 */
    align-self: flex-start;
    /* align-self-start */
    margin-right: auto;
    /* mr-auto */
}

.chat-input-area {
    display: flex;
    /* flex */
    gap: 0.5rem;
    /* gap-2 */
    margin-top: 1rem;
    /* mt-4 */
}

.chat-input-area .input-field {
    flex-grow: 1;
    /* flex-grow */
    margin-top: 0;
    /* Override default margin */
    color: #000000;
}

.chat-send-button {
    padding: 0.75rem 1.25rem;
    /* py-3 px-5 */
    border-radius: 0.75rem;
    /* rounded-xl */
    background-color: #4f46e5;
    /* indigo-600 */
    color: white;
    /* text-white */
    font-weight: 600;
    /* font-semibold */
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    /* Remove default button border */
}

.chat-send-button:hover {
    background-color: #4338ca;
    /* indigo-700 */
}

.chat-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-chat-button {
    background-color: #f59e0b;
    /* amber-500 */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 1rem;
    /* mb-4 */
    border: none;
    /* Remove default button border */
}

.clear-chat-button:hover {
    background-color: #d97706;
    /* amber-600 */
}

/* Background image for sections */
.section-background-image {
    position: absolute;
    /* absolute */
    top: 50%;
    /* top-1/2 */
    left: 50%;
    /* left-1/2 */
    transform: translate(-50%, -50%);
    /* -translate-x-1/2 -translate-y-1/2 */
    width: 100%;
    /* w-full */
    max-width: none;
    /* max-w-none */
    height: auto;
    /* h-auto */
    opacity: 0.2;
    /* opacity-20 or opacity-25 */
    filter: blur(48px);
    /* blur-3xl */
    pointer-events: none;
    /* pointer-events-none */
    z-index: 1;
    /* z-10 */
    transition: transform 0.1s linear;
    /* Smooth movement for parallax */
}

.section-content-wrapper {
    position: relative;
    /* relative */
    z-index: 2;
    /* z-10 */
    padding: 1rem;
    /* p-4 */
}

/* New styles for scroll animation */
.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    /* Start slightly below */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}
video{
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 10px;
}

/* OCR Scanning  */

container {
    background-color: #ad6ae8;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

h1, h2 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.camera-section{
    
    padding: 20px;
    border-radius: 0px;
    background-color: #352d3a;
}
.instructions{
    background-color: rgb(172, 123, 222), rgb(137, 74, 226);
}
.ocr-section,h2{
    padding: 20px;
    border-radius: 0px;
    background-color: #352d3a;
    font-size: 1.5rem;
    color: white;
}

.camera-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden; /* Ensure content stays within bounds */
}

#cameraFeed {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1); /* Mirror camera feed for selfie-like experience */
}

#overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to pass through to video */
    transform: scaleX(-1); /* Mirror bounding boxes to match video */
}


button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto;
}

#startCameraButton {
    background-color: #007bff;
    color: white;
}
#startCameraButton:hover {
    background-color: #0056b3;
}

#stopCameraButton {
    background-color: #dc3545;
    color: white;
}
#stopCameraButton:hover:not(:disabled) {
    background-color: #c82333;
}
#stopCameraButton:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#processingRate {
    width: 80%;
    margin-top: 10px;
}

#rateValue {
    font-weight: bold;
    color: #555;
}

#ocrStatus {
    margin-top: 10px;
    font-style: italic;
    color: #666;
    text-align: center;
}

#ocrResult {
    background-color: #e9e9e9;
    padding: 15px;
    border-radius: 4px;
    min-height: 100px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    color: #333;
    text-align: left;
    overflow-y: auto; /* Enable scrolling if text is long */
    max-height: 200px;
}

.instructions ul {
    list-style-type: disc;
    padding-left: 20px;
    color: #555;
}
.instructions li {
    margin-bottom: 5px;
}
/* ... (previous CSS remains) ... */

.camera-controls {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

#cameraSelect {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 16px;
    flex-grow: 1; /* Allow select to take up available space */
    min-width: 150px; /* Ensure it's not too small */
}

/* ... (rest of the CSS) ... */