/* Add screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #000000;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    max-width: 480px;
    margin: 0 auto;
    overflow-y: hidden; /* Prevent whole body scrolling */
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #1a1a1a, #000000);
    z-index: -2;
}

/* Space effect */
@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    z-index: -1; /* Ensure stars are behind welcome screen */
}

.welcome-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    opacity: 1;
    transition: opacity 1s ease-out;
    z-index: 1000;
    pointer-events: none;
}

.welcome-screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes hypnotic-pulse {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.2); 
    }
    100% { 
        transform: scale(1); 
    }
}

.hypnotic-pulse {
    animation: hypnotic-pulse 2s ease-in-out;
}

.welcome-title {
    color: #ffffff;
    font-size: 2em; 
    margin-top: 10px; 
    font-weight: 500;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #121212;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.header-title {
    color: white;
    font-size: 1.2em;
    font-weight: 500;
    flex-grow: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-title-arrow {
    width: 24px;
    height: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    background: transparent; 
    display: flex;
    flex-direction: column;
    padding-bottom: 100px; 
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent; 
    max-height: calc(100vh - 180px); 
    padding-bottom: 120px; 
    scrollbar-width: thin; 
    scrollbar-color: rgba(255,255,255,0.3) transparent; 
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.name {
    font-size: 1.1em;
    font-weight: 500;
}

.message {
    display: flex;
    margin-bottom: 10px;
    max-width: 80%;
    align-self: flex-start; 
}

.message.user {
    justify-content: flex-end;
    align-self: flex-end;
}

.bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95em;
    line-height: 1.4;
    word-wrap: break-word; 
    overflow-wrap: break-word;
}

.user .bubble {
    background: #006064;
    color: white;
    border-radius: 15px 15px 0 15px;
}

.ai .bubble {
    background: #1a1a1a;
    color: white;
    border-radius: 15px 15px 15px 0;
}

.new-chat-button-container {
    display: none;
}

.new-chat-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: rgba(42, 42, 42, 0.5); 
    color: white;
    border: 1px solid rgba(255,255,255,0.3); 
    border-radius: 25px; 
    padding: 8px 20px; 
    cursor: pointer;
    transition: background-color 0.3s, backdrop-filter 0.3s;
    font-size: 0.9em;
    backdrop-filter: blur(5px); 
}

.new-chat-button:hover {
    background-color: rgba(58, 58, 58, 0.7);
}

.chat-input {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 460px;
    padding: 10px 15px;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    border: none;
    margin-bottom: 10px;
    border-radius: 25px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 
                0 8px 24px rgba(0,0,0,0.05);
    backdrop-filter: blur(15px); 
    background-color: rgba(0,0,0,0.1); 
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    resize: none;
    padding: 8px;
    line-height: 1.4;
    min-height: 40px;
    margin: 0;
    outline: none;
}

#new-chat-button {
    background-color: rgba(255,255,255,0.1);
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    display: flex;
    transition: opacity 0.3s ease;
}

#new-chat-button:hover {
    background-color: rgba(255,255,255,0.2);
}

#new-chat-button.active {
    transform: scale(0.95);
    background-color: rgba(255,255,255,0.3);
}

.chat-input.has-text #new-chat-button {
    display: none;
}

.broom-icon {
    width: 24px !important;
    height: 24px !important;
    color: white;
}

.action-button {
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.action-button:hover {
    background-color: rgba(255,255,255,0.2);
}

.action-button svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.3s ease;
}

.action-button:hover svg {
    transform: scale(1.1);
}

.send-icon, .mic-icon {
    transition: opacity 0.3s ease;
}

.chat-input:not(.has-text) .send-icon {
    display: none;
}

.chat-input.has-text .mic-icon {
    display: none;
}

#send-button.listening {
    background-color: #006064;
}

/* Sidebar Menu Styles */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: #1a1a1a;
    z-index: 2000;
    transition: transform 0.3s ease-in-out;
    transform: translateX(0);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    position: relative;
}

.sidebar-website-title {
    color: white;
    font-size: 1.2em;
    text-align: left;
    margin: 0;
}

.close-sidebar {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    position: static;
    top: auto;
    right: auto;
}

.sidebar-menu.open {
    transform: translateX(280px);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Chat History Styles */
.chat-history-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.chat-history-title {
    color: white;
    font-size: 1.1em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-history-item {
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 12px 15px;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.3s;
    position: relative;
}

.chat-history-item:hover {
    background-color: rgba(255,255,255,0.1);
}

.chat-history-item.active {
    background-color: rgba(0,96,100,0.5);
}

/* Delete Dialog */
.delete-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s;
}

.delete-dialog.show {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.3s;
}

.delete-dialog-content {
    background-color: #2a2a2a;
    color: white;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    max-width: 90%;
    text-align: center;
}

.delete-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.confirm-delete-btn {
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.cancel-delete-btn {
    background-color: transparent;
    color: white;
    border: 1px solid white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.social-media-icons {
    display: none; 
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    margin-top: auto;
    margin-bottom: 20px;
}

.social-media-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.social-media-icons a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.social-media-icons svg {
    width: 24px;
    height: 24px;
}

.ai-model-dropdown {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    width: calc(100% - 32px);
    max-width: 420px;
    background-color: #1a1a1a;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    transform-origin: top center;
    overflow: hidden;
}

.ai-model-dropdown.open {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
}

.ai-model-list {
    display: flex;
    flex-direction: column;
}

.ai-model-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ai-model-item:hover {
    background-color: rgba(255,255,255,0.1);
}

.ai-model-item .model-name {
    color: white;
    font-size: 1em;
    font-weight: 500;
}

.ai-model-item .model-description {
    color: rgba(255,255,255,0.7);
    font-size: 0.8em;
    margin-top: 5px;
}

.ai-model-item:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ai-model-item:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

button, a, [role="button"] {
    outline: none;
}

button:focus, a:focus, [role="button"]:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.welcome-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.gino-brand-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.gino-brand-text {
    display: flex;
    gap: 10px;
    font-size: 4em;
    font-weight: bold;
}

.gino-letter {
    opacity: 0;
    transform: scale(0.5);
    animation: brandReveal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes brandReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 480px) {
    body {
        max-width: 100%;
    }
}