/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-width: 260px; /* Default sidebar width */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #00101e;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    border-radius: 15%;
}

/* App container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    border-radius: 15;
    position: relative;
}

/* Hover area for sidebar */
.sidebar-hover-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 100%;
    z-index: 10;
    cursor: pointer;
}

/* Add a subtle indicator for the hover area - only visible when sidebar is hidden */
.sidebar-hover-area::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 5px;
    width: 5px;
    height: 40px;
    background-color: rgba(0, 255, 200, 0.3);
    border-radius: 3px;
    transform: translateY(-50%);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* When sidebar is visible, move the indicator to match sidebar width */
.sidebar-visible::after {
    opacity: 0;
    transform: translateY(-50%) translateX(var(--sidebar-width, 260px));
}

/* Make indicator fade out when hovered directly */
.sidebar-hover-area:hover::after {
    opacity: 0;
}

/* Sidebar styles */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, #0e2438 0%, #081218 100%);
    color: #e6e6e6;
    display: flex;
    flex-direction: column;
    border-radius: 5px;
    height: 100%;
    border-right: 1px solid #004637;
    position: absolute;
    left: -260px;
    transition: left 0.3s ease-in-out;
    z-index: 5;
    justify-content: flex-start;
}

/* Show sidebar when hover area or sidebar is hovered */
.sidebar-hover-area:hover + .sidebar,
.sidebar:hover {
    left: 0;
}

.new-chat {
    padding: 10px;
    margin: 10px;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2b2d30 0%, #1a1b1d 100%);
    color: #00ffc8;
    border: 1px solid #004637;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.new-chat-btn:hover {
    background: linear-gradient(135deg, #404040 0%, #2a2a2a 100%);
}

.sidebar-conversations {
    flex: 1;
    overflow-y: auto;
    border-radius: 5px;
    padding: 10px;
}

.conversation-item {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #adffed;
    transition: background-color 0.3s;
    position: relative;
}

.conversation-item:hover {
    background: linear-gradient(135deg, #2b2d30 0%, #1a1b1d 100%);
}

.conversation-item.active {
    background: linear-gradient(135deg, #2b2d30 0%, #1a1b1d 100%);
}

.conversation-content {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 2px;
}

.delete-btn {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 5px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-item:hover .delete-btn {
    opacity: 1;
    transform: translateX(0);
}

.delete-btn:hover {
    color: #ff6666;
}

.sidebar-footer {
    padding: 15px;
    border-radius: 5px;
    border-bottom: 1px solid #004637;
    order: -1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #adffed;
    cursor: pointer;
    padding: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(43, 45, 48, 0) 0%, rgba(26, 27, 29, 0) 100%);
    border: 1px solid transparent;
}

.user-info:hover {
    background: linear-gradient(135deg, #2b2d30 0%, #1a1b1d 100%);
    color: #00ffc8;
    border: 1px solid #004637;
    box-shadow: 0 2px 8px rgba(0, 255, 200, 0.1);
}

.user-info i {
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.user-info:hover i {
    transform: scale(1.1);
    color: #00ffc8;
}

.user-info span {
    transition: all 0.3s ease;
}

.user-info:hover span {
    transform: translateX(2px);
}

/* Main content styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e1e1e 0%, #151515 100%);
    margin-left: 0;
    transition: margin-left 0.3s ease-in-out;
    width: 100%;
}

/* Adjust main content margin when sidebar is visible */
.sidebar-hover-area:hover + .sidebar + .main-content,
.sidebar:hover + .main-content {
    margin-left: 260px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 5px;
    background: transparent;
}

.chat-header {
    background: linear-gradient(135deg, #2b2d30 0%, #1a1b1d 100%);
    color: #00ffc8;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #004637;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    padding: 10px 0;
}

.message-content {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 2px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    border: 2px solid #00ffc8;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.2);
}

/* Luna's SVG Avatar Animations */
.avatar svg {
    width: 100%;
    height: 100%;
    padding: 2px;
}

.avatar .rotating-circle {
    animation: rotate 8s linear infinite;
    transform-origin: center;
}

.avatar .geometric-pattern {
    animation: pulse 4s ease-in-out infinite;
    transform-origin: center;
}

.avatar .pulsing-core {
    animation: glow 2s ease-in-out infinite;
}

.avatar .decorative-line {
    animation: flash 3s linear infinite;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
}

.avatar .tech-dot {
    animation: techPulse 2s ease-in-out infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
}

@keyframes glow {
    0%, 100% {
        r: 10;
        fill-opacity: 0.8;
    }
    50% {
        r: 12;
        fill-opacity: 1;
    }
}

@keyframes flash {
    0% {
        stroke-dashoffset: 60;
        opacity: 0.3;
    }
    50% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: -60;
        opacity: 0.3;
    }
}

@keyframes techPulse {
    0%, 100% {
        opacity: 0.5;
        r: 3;
    }
    50% {
        opacity: 1;
        r: 4;
    }
}

.user-message .avatar {
    background-color: #adffed;
}

.text {
    color: #ffffff;
    line-height: 1.5;
    padding-top: 5px;
}

.message strong {
    color: #adffed;
    margin-bottom: 5px;
    display: block;
}

.user-message {
    background: linear-gradient(135deg, rgba(174, 174, 174, 0.2) 0%, rgba(174, 174, 174, 0.05) 100%);
    border-radius: 8px;
    padding: 15px;
    align-self: flex-end;
}

.assistant-message {
    background-color: rgba(174, 174, 174, 0.0);
    border-bottom: 1px solid rgba(0, 70, 55, 0);
    padding-bottom: 20px;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #004637;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #363636 0%, #252525 100%);
    border: 1px solid #00ffc8;
    border-radius: 8px;
    padding: 8px 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    padding: 8px 0;
    resize: none;
    outline: none;
    max-height: 200px;
    overflow-y: auto;
}

#chat-input::placeholder {
    color: #888;
}

.send-button {
    background: none;
    border: none;
    color: #00ffc8;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.send-button:hover {
    color: #adffed;
}

.input-footer {
    margin-top: 10px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

.loading {
    color: #00ffc8;
    margin: 10px 0;
    font-style: italic;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
        left: -240px;
    }
    
    .sidebar-hover-area:hover + .sidebar,
    .sidebar:hover {
        left: 0;
    }
    
    .sidebar-hover-area:hover + .sidebar + .main-content,
    .sidebar:hover + .main-content {
        margin-left: 240px;
    }
    
    .sidebar-hover-area {
        width: 15px;
    }
    
    .sidebar-hover-area::after {
        left: 3px;
        width: 4px;
        height: 30px;
    }
    
    /* Update indicator movement for smaller sidebar */
    .sidebar-visible::after {
        transform: translateY(-50%) translateX(240px);
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 200px;
        left: -200px;
    }
    
    .sidebar-hover-area:hover + .sidebar + .main-content,
    .sidebar:hover + .main-content {
        margin-left: 200px;
    }
    
    /* Update indicator movement for even smaller sidebar */
    .sidebar-visible::after {
        transform: translateY(-50%) translateX(200px);
    }
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 100; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #0e2438;
    color: #e6e6e6;
    padding: 20px;
    border: 1px solid #004637;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.ok-button {
    background: linear-gradient(135deg, #2b2d30 0%, #1a1b1d 100%);
    color: #00ffc8;
    border: 1px solid #004637;
    border-radius: 6px;
    cursor: pointer;
    padding: 10px 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.ok-button:hover {
    background: linear-gradient(135deg, #404040 0%, #2a2a2a 100%);
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 27, 29, 0.8);
    border-radius: 4px;
}

/* Scrollbar animations */
@keyframes glow-scrollbar {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 200, 0.3);
    }
    50% {
        box-shadow: 0 0 8px rgba(0, 255, 200, 0.5);
    }
}

/* Enhanced scrollbar styling */
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00ffc8 0%, #008f72 100%);
    border-radius: 4px;
    transition: all 0.3s ease;
    animation: glow-scrollbar 4s infinite;
}

/* Make scrollbar blend in when not in use */
::-webkit-scrollbar-thumb {
    opacity: 0.7;
}

::-webkit-scrollbar-thumb:hover {
    opacity: 1;
    background: linear-gradient(135deg, #00ffc8 0%, #00c49a 100%);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #00ffc8 rgba(26, 27, 29, 0.8);
}

/* Specific scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #00ffc8 0%, #008f72 100%);
    border-radius: 3px;
    box-shadow: 0 0 5px rgba(0, 255, 200, 0.3);
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(14, 36, 56, 0.3);
    border-radius: 3px;
}

/* Specific scrollbar for sidebar conversations */
.sidebar-conversations::-webkit-scrollbar {
    width: 4px;
}

.sidebar-conversations::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #00ffc8 0%, #008f72 100%);
    border-radius: 2px;
}

.sidebar-conversations::-webkit-scrollbar-track {
    background: rgba(14, 36, 56, 0.2);
    border-radius: 2px;
}

/* Make scrollbar more visible on hover */
.chat-messages:hover::-webkit-scrollbar-thumb,
.sidebar-conversations:hover::-webkit-scrollbar-thumb {
    box-shadow: 0 0 8px rgba(0, 255, 200, 0.5);
}

/* Luna's avatar fallback for Android Chrome */
.luna-avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,255,200,0.8) 0%, rgba(0,255,200,0.3) 70%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.luna-avatar-fallback::before {
    content: "";
    position: absolute;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,255,200,0.9) 0%, rgba(0,255,200,0.5) 100%);
    animation: pulse 2s infinite ease-in-out;
}

.luna-avatar-fallback::after {
    content: "";
    position: absolute;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    background-color: #00ffc8;
    animation: glow 2s infinite ease-in-out;
}

/* Luna's avatar fallback image for Android Chrome */
.luna-avatar-fallback-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
} 