/* 
         ANALYSIS:
         - The overall page has a very dark, almost black background.
         - All content is centered vertically and horizontally.
         - The font is a clean, modern sans-serif. I've chosen 'Manrope' which is a close match.
        */
:root {
    --bg-color: #191A1A;
    --container-bg-color: #1F2020;
    --border-color: #3e3e3e;
    --text-primary: #646563bd;
    --text-secondary: #8e8e8e;
    --accent-color: #30c5b5;
    --accent-bg-dark: #1d4a51;
    --btn-secondary-bg: #181B1B;
    /* Sidebar */
    --sidebar-width: 240px;
    --sidebar-hover: #232525;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    min-height: 100vh;
}


/* App shell: sidebar + content */
.app-shell {
    position: relative;
    min-height: 100svh;
}

/* Center content area vertically/horizontally, as before */
.page-content {
    min-height: 100svh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: margin-left 280ms ease;
}

.app-shell[data-sidebar-open="true"] .page-content {
    margin-left: var(--sidebar-width);
}

/* 
         ANALYSIS:
         - A main container holds all elements and centers them in a vertical column.
         - This allows for easy spacing between the logo, search bar, and suggestions.
        */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    width: 100%;
    max-width: 720px;
}

/* Staggered animations for individual elements */
.title-container {
    animation: fadeInUp 0.4s ease-out;
}

.search-wrapper {
    animation: fadeInUp 0.4s ease-out 0.1s backwards;
}



/* Controls animations */
.right-controls>* {
    animation: fadeInUp 0.3s ease-out backwards;
}

.right-controls>*:nth-child(1) {
    animation-delay: 0.15s;
}

.right-controls>*:nth-child(2) {
    animation-delay: 0.2s;
}

.right-controls>*:nth-child(3) {
    animation-delay: 0.25s;
}

.right-controls>*:nth-child(4) {
    animation-delay: 0.3s;
}

.left-controls {
    animation: fadeInUp 0.3s ease-out 0.15s backwards;
}

/* Signup Button - positioned absolute top right */
.signup-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;

    /* Styling to match sidebar create-btn - smaller size */
    background: #26a69a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-block;
    cursor: pointer;
}

.signup-btn:hover {
    background-color: #24978c;
    transform: translateY(-1px);
}

.signup-btn:active {
    transform: translateY(0);
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .signup-btn {
        top: 0.75rem;
        right: 0.75rem;
        padding: 5px 10px;
        font-size: 11px;
    }

    .upgrade-btn {
        top: 0.75rem;
        padding: 10px 20px;
    }

    .upgrade-text {
        font-size: 12px;
    }

    /* On mobile, keep upgrade button centered regardless of sidebar */
    .app-shell[data-sidebar-open="true"] .upgrade-btn {
        left: 50%;
    }
}

/* 
         ANALYSIS:
         - The logo "perplexity" is white, lowercase, and has a distinct letter-spacing and font weight.
         - The font size is large to establish it as the primary brand element.
        */
.title-container {
    font-size: 48px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -2px;
}

/* 
         ANALYSIS:
         - This is the main search box. It's a large container with rounded corners, a subtle border, and a slightly lighter background than the page.
         - It uses flexbox with column direction to stack the textarea and the controls bar.
         - Padding is added to create internal space.
        */
.search-wrapper {
    background-color: var(--container-bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 12px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 
         ANALYSIS:
         - The text area has a transparent background to blend with its parent container.
         - The placeholder text "Ask anything..." is a lighter gray color.
         - There's no border or outline to make it feel seamless.
         - A specific height is set to match the image's proportions.
        */
.input-container {
    position: relative;
    min-height: 54px;
    max-height: 200px;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.editable-input {
    background-color: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    caret-color: #30c5b5;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    min-height: 54px;
    max-height: 200px;
    padding: 0px 0;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.editable-input:empty::before {
    content: attr(placeholder);
    color: #5a5a5abd;
    pointer-events: none;
}

.editable-input::-webkit-scrollbar {
    width: 6px;
}

.editable-input::-webkit-scrollbar-track {
    background: transparent;
}

.editable-input::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.editable-input::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* 
         ANALYSIS:
         - This bar at the bottom of the search box holds all the action buttons and icons.
         - It uses flexbox with `justify-content: space-between` to push the left and right controls to opposite ends.
        */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 
         ANALYSIS:
         - Both left and right control groups use flexbox to align their items horizontally.
         - A gap is used for spacing between the icons/buttons.
        */
.right-controls {
    display: flex;
    align-items: center;
    gap: 10px;

}

.left-controls {
    display: flex;
    align-items: center;
    background-color: #181B1B;
    border-radius: 10px;
    gap: 0px;
    position: relative;
    padding: 2px;
}

.left-controls .sliding-bg {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    background-color: var(--accent-bg-dark);
    border-radius: 8px;
    transition: transform 0.3s ease;
    z-index: 0;
    left: 2px;
    top: 2px;
}

/* 
         ANALYSIS:
         - These are the two small buttons on the left. They have a dark background, a subtle border, and rounded corners.
         - They are small and contain only an icon.
        */
.control-btn {
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.control-btn:hover {
    transform: translateY(-2px);
}

/* 
         ANALYSIS:
         - The active button (search icon) has a unique dark teal background and a bright teal border and icon color, making it stand out.
        */
.control-btn.active {
    color: var(--accent-color);
}

/* 
         ANALYSIS:
         - The icons on the right side are simple, gray, and have a pointer cursor to indicate they are clickable.
        */
.right-controls>i {
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease, transform 0.2s ease;
}

.right-controls>i:hover {
    color: var(--accent-color);
}

/* 
         ANALYSIS:
         - This is the main voice input button. It's larger than the other icons and has a solid dark gray background.
         - The icon inside is white, contrasting with the button's background.
        */
.voice-btn {
    background-color: #3a3a3a;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    /* for the arrow icon when typing */
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.voice-btn:hover {
    background-color: #4a4a4a;
}

.transmission-icon {
    fill: #ffffff;
    /* white bars */
}

/* Smooth fade/scale transition when swapping icons */
.voice-btn {
    position: relative;
}

.voice-btn .icon {
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: opacity 120ms ease, transform 120ms ease;
    will-change: opacity, transform;
}

.voice-btn.fading .icon {
    opacity: 0;
    transform: scale(0.85);
}

/* Animated recording bars */
.recording-icon {
    fill: #ffffff;
}

.recording-icon rect {
    transform-box: fill-box;
    /* scale from center so bars extend up and down */
    transform-origin: 50% 50%;
    animation: eq 0.9s ease-in-out infinite;
}

.recording-icon .bar-1 {
    animation-delay: 0s;
}

.recording-icon .bar-2 {
    animation-delay: 0.12s;
}

.recording-icon .bar-3 {
    animation-delay: 0.24s;
}

.recording-icon .bar-4 {
    animation-delay: 0.36s;
}

@keyframes eq {

    0%,
    100% {
        transform: scaleY(0.45);
    }

    50% {
        transform: scaleY(1);
    }
}