/* AIM Personal AI Assistance © 2025
   Developed by Eshwar Potnuru for AIM Co.
   All rights reserved.
*/

:root {
    --primary: #001D2A;
    --secondary: #2C2C2C;
    --accent: #00FFA3;
    --accent-light: #3F3F3F;
    --text-dark: #232f3e;
    --text-light: #E2E2E2;
    --glass-light: rgba(44, 44, 44, 0.18);
    --glass-dark: rgba(0, 29, 42, 0.13);
    --success: #00FFA3;
    --warning: #006AF2;
    --error: #1755FA;
    --hover-green: #00FFA3;
    --tile-bg: #232f3e;
    --tile-bg-light: #2e3e4e;
    --tile-border: #00FFA3;
    --tile-shadow: rgba(0,255,163,0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #232f3e, #2e3e4e, #3F3F3F);
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    padding: 2rem;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    backdrop-filter: blur(16px);
    background: var(--glass-light);
    border: 2.5px solid var(--tile-border);
    box-shadow: 0 12px 40px var(--tile-shadow);
    border-radius: 2rem;
    overflow: hidden;
    position: relative;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    background: linear-gradient(90deg, #32455d 80%, #2e3e4e 100%);
    border-bottom: 1px solid var(--glass-dark);
}

.hero-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(90deg, #00FFA3, #006AF2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.hero-content h2 {
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
}

.profile-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00FFA3;
    box-shadow: 0 0 20px #00FFA3;
    transition: all 0.3s ease;
}

.profile-img:hover {
    box-shadow: 0 0 30px #00FFA3;
}

.main-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 3rem;
}

.portfolio-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.portfolio-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
}

.portfolio-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-card {
    background: linear-gradient(135deg, var(--tile-bg-light) 80%, var(--tile-bg) 100%);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 2px solid var(--tile-border);
    box-shadow: 0 8px 32px var(--tile-shadow);
}

.profile-card h3 {
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 2px 8px #232f3e;
}

.profile-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.social-links a {
    background: #2e3e4e;
    color: #E2E2E2;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    background: var(--hover-green);
    color: #232323 !important;
}

.info-card {
    background: linear-gradient(135deg, var(--tile-bg-light) 80%, var(--tile-bg) 100%);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 2px solid var(--tile-border);
    box-shadow: 0 8px 32px var(--tile-shadow);
    width: 100%;
}

.info-card h2 {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 8px #232f3e;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.info-item {
    background: var(--tile-bg-light);
    color: #E2E2E2;
    border: 1.5px solid var(--tile-border);
    border-radius: 0.8rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px #232f3e;
    transition: background 0.3s, color 0.3s;
}

.info-item:hover {
    background: var(--hover-green);
    color: #232323 !important;
    border-color: var(--hover-green) !important;
}

.info-item i {
    font-size: 1.1rem;
    color: var(--accent);
    min-width: 24px;
}

.info-item span, .info-item a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

.chat-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-area {
    background: linear-gradient(135deg, #232f3e 80%, #2e3e4e 100%);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 2px solid var(--tile-border);
    box-shadow: 0 8px 32px var(--tile-shadow);
    display: flex;
    flex-direction: column;
    min-height: 70vh;
    height: 70vh;
    overflow-y: auto;
    /* Fix scrollbar positioning */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}

/* Enhanced scrollbar styling for better alignment */
.chat-area::-webkit-scrollbar {
    width: 6px;
}

.chat-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 8px 0; /* Add margin to keep scrollbar within container borders */
}

.chat-area::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1); /* Subtle border for better definition */
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: #00cc82; /* Slightly darker accent on hover */
}

.chat-area::-webkit-scrollbar-corner {
    background: transparent;
}

.message {
    max-width: 80%;
    padding: 1rem 1.5rem;
    border-radius: 1.2rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.4s ease-out;
    position: relative;
    line-height: 1.6;
}

.ai-message {
    align-self: flex-start;
    background: #2e3e4e;
    border: 1.5px solid var(--tile-border);
    color: #E2E2E2;
    box-shadow: 0 2px 8px #232f3e;
    border-top-left-radius: 0;
}
.ai-message::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #2e3e4e;
    border-left: 0;
    margin-top: 0;
}
.user-message {
    align-self: flex-end;
    background: #2e3e4e;
    border: 2px solid #006AF2;
    color: #E2E2E2;
    box-shadow: 0 4px 16px #006AF233;
    border-top-right-radius: 0;
    font-weight: 600;
}
.user-message::before {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-left-color: #E2E2E2;
    border-right: 0;
    margin-top: 0;
}

.message-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: white;
}

.features-list {
    list-style: none;
    margin-top: 1rem;
}
.features-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
}
.features-list li i {
    color: var(--accent);
    width: 20px;
    text-align: center;
}

.input-area {
    background: linear-gradient(135deg, #232f3e 80%, #2e3e4e 100%);
    border-radius: 1.5rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--tile-border);
    box-shadow: 0 8px 32px var(--tile-shadow);
    display: flex;
    gap: 0.8rem;
    position: relative;
}

#user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    color: white;
    transition: all 0.3s ease;
}
#user-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(245, 87, 108, 0.3);
}
#user-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
    color: #E2E2E2;
    position: relative;
    overflow: hidden;
    background: #2e3e4e;
}
.input-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.input-btn:hover::after {
    transform: translateX(100%);
}
#send-btn {
    background: linear-gradient(135deg, #00FFA3 60%, #006AF2 100%);
    color: #232f3e;
    font-weight: 600;
    border: 1.5px solid #00FFA3;
    box-shadow: 0 4px 15px var(--hover-green);
}
#send-btn:hover {
    background: #E2E2E2;
    color: #232323;
    border-color: #006AF2;
}
#mic-btn {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}
#game-btn {
    background: linear-gradient(135deg, #8ec5fc, #e0c3fc);
    box-shadow: 0 4px 15px rgba(142, 197, 252, 0.4);
    color: var(--primary);
}
.input-btn:hover {
    background: var(--hover-green);
    color: #232323 !important;
    box-shadow: 0 6px 20px var(--hover-green);
}
.input-btn:active {
    transform: translateY(1px);
}

.game-menu {
    position: absolute;
    bottom: 60px;
    right: 10px;
    background: linear-gradient(135deg, var(--glass-light), var(--glass-dark));
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1rem;
    width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-light);
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}
.game-menu.active {
    display: flex;
}
.game-menu h4 {
    font-size: 1rem;
    color: white;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 500;
}
.game-option {
    background: #2C2C2C;
    color: #E2E2E2;
    border: 1px solid #3F3F3F;
    border-radius: 0.8rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.game-option i {
    font-size: 0.9rem;
    color: var(--accent);
}
.game-option:hover {
    background: var(--hover-green);
    color: #232323 !important;
    border-color: var(--hover-green) !important;
    transform: translateX(5px);
}

footer {
    background: linear-gradient(90deg, #001D2A, #2C2C2C);
    padding: 1.2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #E2E2E2;
    border-top: 1px solid var(--glass-light);
}
footer a {
    color: #00FFA3;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
footer a:hover {
    color: #006AF2;
    text-decoration: underline;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(106, 17, 203, 0.2);
    border-radius: 1.2rem;
    width: fit-content;
    margin-bottom: 1rem;
    align-self: flex-start;
    border: 1px solid rgba(106, 17, 203, 0.3);
}
.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-5px); opacity: 1; background: var(--accent); }
}

/* Language toggle buttons */
.lang-toggle {
    background: #2e3e4e !important;
    color: #E2E2E2 !important;
    border: 1.5px solid #00FFA3 !important;
    border-radius: 1rem !important;
    padding: 0.4rem 0.8rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: auto !important;
    height: auto !important;
}

.lang-toggle:hover {
    background: #00FFA3 !important;
    color: #232323 !important;
    border-color: #00FFA3 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,255,163,0.3) !important;
}

.lang-toggle.active {
    background: #00FFA3 !important;
    color: #232323 !important;
    border-color: #00FFA3 !important;
    box-shadow: 0 0 15px rgba(0,255,163,0.5) !important;
}

.voice-toggle-wrapper {
    display: flex !important;
    gap: 0.8rem !important;
    align-items: center !important;
}

#voice-toggle {
    background: #2e3e4e !important;
    color: #E2E2E2 !important;
    border: 1.5px solid #006AF2 !important;
    border-radius: 1rem !important;
    padding: 0.4rem 0.8rem !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: auto !important;
    height: auto !important;
}

#voice-toggle:hover {
    background: #006AF2 !important;
    color: #E2E2E2 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,106,242,0.3) !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container { 
        flex-direction: column; 
        gap: 1.5rem;
    }
    .hero { flex-direction: column; text-align: center; gap: 1.5rem; }
    .hero-content p { max-width: 100%; }
    .chat-area {
        min-height: 60vh;
        height: 60vh;
    }
    .portfolio-content {
        align-items: center;
    }
    .social-links {
        justify-content: center;
    }
}
@media (max-width: 768px) {
    body { background: #001D2A; color: #E2E2E2; padding: 1rem; }
    .container { border-radius: 1rem; }
    .hero { padding: 1.5rem; }
    .hero-content h1 { font-size: 2rem; }
    .hero-content h2 { font-size: 1.1rem; }
    .main-container { padding: 1.5rem; gap: 1.5rem; }
    .chat-area {
        min-height: 50vh;
        height: 50vh;
        padding: 1rem;
    }
    .input-area { flex-wrap: wrap; }
    #user-input { min-width: 100%; order: 1; }
    .input-btn { width: 40px; height: 40px; font-size: 1rem; }
    .social-links {
        justify-content: center;
        gap: 1rem;
    }
    .portfolio-links .info-item {
        text-align: center;
    }
}

.input-btn:hover,
.info-item:hover,
.social-links a:hover,
.game-option:hover {
    background: var(--hover-green) !important;
    color: #232323 !important;
    border-color: var(--hover-green) !important;
}
.input-btn:hover i,
.info-item:hover i,
.social-links a:hover i,
.game-option:hover i {
    color: #232323 !important;
}
/* Ensure child spans and links also turn black on hover */
.info-item:hover span,
.info-item:hover a,
.game-option:hover span,
.game-option:hover a,
.social-links a:hover span,
.input-btn:hover span {
    color: #232323 !important;
}
