@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
    --bg-color: #2c3e50;
    /* --container-bg: rgba(44, 62, 80, 0.8);
    --input-bg: #34495e;
    --chat-bubble-bg: #34495e; */
    --primary-color: #2ecc71;
    --text-color: #ecf0f1;
    --border-color: #7f8c8d;
    --chat-bubble-text: #ecf0f1;
    --icon-color: #ecf0f1;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --font-family: 'Poppins', sans-serif;
}

/* Reset & global settings */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url("https://assets.science.nasa.gov/dynamicimage/assets/science/esd/multimedia/images-of-change/FestiveFields_NC_20141019_after_2048px-95.jpg") no-repeat center center fixed;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-top: 8px;
    max-width: 1200px; 
    background-color: var(--container-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 96vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo img {
    height: 120px;
}

.logo h1 {
    font-size: clamp(1.5rem, 2.5vw, 3rem); /* scales dynamically */
    color: var(--primary-color);
    text-shadow: 2px 2px 4px var(--shadow-color);
    font-style: italic;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}



.tagline {
    font-size: clamp(0.9rem, 1.2vw, 1.5rem);
    margin-bottom: 10px;
    text-align: center;
}

.developer-info {
    font-size: clamp(0.7rem, 0.9vw, 1rem);
    color: var(--border-color);
    margin-bottom: 20px;
    text-align: center;
}

.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 5px;
    margin-bottom: 20px;
}

.input-box {
    position: relative;
    width: 100%;
    border-radius: 25px;
    display: flex;
    gap: 10px;
    
}


.chat-area .input-box .message{
    width:100%;
    padding: 15px 20px;
    word-wrap: break-word;
    border-radius: 12px 12px 0 12px;
    background-color: var(--input-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    text-wrap: wrap;
    display: flex;
    justify-content: end;
    
}
.chat-area .input-box .message p{
    margin:0;
    padding:0;
    text-align: justify;
}

.input-box svg {
    color: var(--icon-color);
    height: 20px;
    width: 20px;
}

.input-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-color);
    flex-grow: 1;
    font-size: 1em;
    padding:0;
    margin:0;
}

.input-box input::placeholder {
    color: var(--border-color);
}

.chat-bubble {
    background-color: var(--chat-bubble-bg);
    padding: 15px 20px;
    border-radius: 20px 20px 20px 0;
    max-width: 100%;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
}

/* Modern AI Assistant Formatting Styles */
.ai-heading {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-color);
    margin: 16px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: block;
}

.ai-text {
    margin: 12px 0;
    line-height: 1.7;
    color: var(--chat-bubble-text);
    font-size: 0.95em;
}

.ai-bold {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(46, 204, 113, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.ai-italic {
    font-style: italic;
    color: #bdc3c7;
}

.ai-list {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.ai-list li {
    margin: 10px 0;
    padding-left: 24px;
    line-height: 1.6;
    position: relative;
    color: var(--chat-bubble-text);
}

.ai-list li::before {
    content: "●";
    color: var(--primary-color);
    font-size: 1.1em;
    position: absolute;
    left: 8px;
    top: 0;
}

.ai-numbered-list {
    margin: 16px 0;
    padding-left: 24px;
    counter-reset: ai-counter;
}

.ai-numbered-list li {
    margin: 10px 0;
    line-height: 1.6;
    color: var(--chat-bubble-text);
    counter-increment: ai-counter;
    position: relative;
}

.ai-numbered-list li::before {
    content: counter(ai-counter) ".";
    color: var(--primary-color);
    font-weight: 600;
    position: absolute;
    left: -24px;
    top: 0;
}

/* Enhanced chat bubble styling */
.chat-bubble {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.formatted-content {
    line-height: 1.6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Legacy support for old formatting */
.chat-bubble strong {
    color: var(--primary-color);
    font-weight: 600;
}

.chat-bubble ul {
    margin: 15px 0;
    padding-left: 25px;
    list-style-type: none;
}

.chat-bubble li {
    margin: 8px 0;
    line-height: 1.5;
    position: relative;
}

.chat-bubble li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -20px;
}

.chat-bubble br {
    line-height: 1.6;
}

.chat-bubble p {
    margin: 8px 0;
}

.formatted-content strong {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

.chat-bubble h3, .chat-bubble h4 {
    color: var(--primary-color);
    margin: 12px 0 8px 0;
}

.chat-bubble-ai {
    background-color: var(--input-bg);
    border-radius: 20px 20px 0 20px;
    align-self: flex-end;
    margin-left: auto;
}

.chat-bubble-user {
    background-color: var(--primary-color);
    border-radius: 20px 20px 20px 0;
    align-self: flex-start;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    text-align: left;
}

.icon-wrapper {
    background-color: var(--primary-color);
    border-radius: 50%;
    padding: 8px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
        backdrop-filter: blur(5px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);


}
.input-box .icon-wrapper {
    margin-right: 0;
    margin-left: 2px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    height: 100%;
    background-color:#fecd50 ;
}


.icon-wrapper svg {
    height: 20px;
    width: 20px;
    color: var(--text-color);
}

.message-content {
    flex-grow: 1;
}

.chat-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.chat-header span {
    font-size: 0.9em;
    color: var(--border-color);
}

.chat-header .label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    flex-wrap: wrap;
}

.chat-header .label svg {
    height: 16px;
    width: 16px;
}

.chat-header .label.translated {
    color: var(--primary-color);
    text-align: justify;
}

.chat-header .label.detected {
    color: #f1c40f;
}


/* Fixed bottom input */
.main-input-container {
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: 5;
    
}

.main-input-container input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 1em;
    width: 80%;
}

.main-input-container input::placeholder {
    color: var(--border-color);
}

.main-input-container .input-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--container-bg);
    border-radius: 30px;
    padding: 4px 8px 4px 16px;
    box-shadow: 0 4px 15px var(--shadow-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
        border: 1px solid rgba(255, 255, 255, 0.1);

}
.main-input-container .input-box button {
    background: none;
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}



.main-input-container button svg {
    height: 20px;
    width: 20px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.container::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.container {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}


/* Media Queries for multiple devices */

/* Large screens 4K / desktop */
@media (min-width: 2560px) {
    .container {
        max-width: 1600px;
        padding: 60px;
    }
    .logo h1 {
        font-size: 4rem;
    }
    .tagline {
        font-size: 2rem;
    }
}

/* Laptops / Desktops */
@media (min-width: 1200px) and (max-width: 2559px) {
    .container {
        max-width: 1000px;
        padding: 50px;
    }
    .logo h1 {
        font-size: 3rem;
    }
    .tagline {
        font-size: 1.5rem;
    }
}

/* Tablets landscape */
@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        max-width: 90%;
        padding: 30px;
    }
    .logo h1 {
        font-size: 2.5rem;
    }
    .tagline {
        font-size: 1.2rem;
    }
}

/* Tablets portrait / large phones */
@media (min-width: 480px) and (max-width: 767px) {
    .container {
        width: 95%;
        padding: 20px;
    }
    .logo {
        gap: 15px;
        padding: 15px;
        margin-bottom: 25px;
    }
    .logo img {
        height: 120px;
    }
    .logo h1 {
        font-size: clamp(1.8rem, 3.5vw, 2.5rem);
        letter-spacing: 1px;
    }
    .tagline {
        font-size: 1rem;
    }
    .main-input-container {
        bottom: 15px;
        width: 95%;
    }
}

/* Small phones */
@media (max-width: 479px) {
    .container {
        width: 95%;
        padding: 15px;
    }
    .logo {
        gap: 12px;
        padding: 12px;
        margin-bottom: 20px;
        flex-direction: column;
    }
    .logo img {
        height: 100px;
    }
    .logo h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        letter-spacing: 1px;
    }
    .tagline {
        font-size: 0.9rem;
    }
    .main-input-container {
        bottom: 10px;
        width: 95%;
    }
}



.mic-icon {
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 12px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .mic-icon:hover {
    background-color: rgba(87, 87, 87, 0.6);
    }

    .mic-icon i {
    font-size: 24px;
    color: #ffffff;
    }

    .commonBtn span {
    position: absolute;
    bottom: 0;
    background-color: rgba(48, 48, 48, 0.5);
    padding: 6px;
    width:100px;
    height: 52px;
    border-radius: 5px;
    color: rgb(139, 139, 139);
    transition: 0.3s;
    display: none;
    }

    .commonBtn:hover span {
    top: -56px;
    display: block;
    }



    #microphone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 21;
    }

    #microphone.visible {
    display: flex;
    }

    #microphone .recoder {
    position: relative;
    width: 90%;
    max-width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
        border: 1px solid rgba(255, 255, 255, 0.1);

    }

    #microphone .close {
    position: absolute;
    top: 8px;
    left: 12px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    }

    #microphone .close span::before,
    #microphone .close span::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 20px;
    background: rgba(241, 241, 241, 0.6);
    border-radius: 2px;
    left: 14px;
    top: 6px;
    }

    #microphone .close span::before { transform: rotate(-45deg); }
    #microphone .close span::after { transform: rotate(45deg); }

    #recoredText {
    font-size: 16px;
    font-weight: 700;
    color: #fdfdfd;
    text-align: center;
    margin: 20px 0;
    }

    #microphone select {
    position: absolute;
    top: 8px;
    right: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: #fdfdfd;
    border: none;
    border-radius: 4px;
    padding: 6px 30px 6px 10px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    width: 280px;
    }

    #microphone select option {
    color: black;
    background: rgba(255, 255, 255, 0.9);
    }

    #microphone select:hover,
    #microphone select:focus {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    }

    #speakBtn {
    position: relative;
    background-color: rgba(51, 51, 51, 0.6);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    }

    #speakBtn i {
    font-size: 32px;
    color: #ffffff;
    }

    #speakBtn.active {
    background-color: rgb(250, 6, 6);
    }

    #speakBtn.active::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid #ff3e38;
    border-radius: 50%;
    animation: zoomin 1s infinite;
    }

    @keyframes zoomin {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(2.5); }
    }

    @media (max-width: 768px) {
    nav { flex-direction: column; gap: 8px; }
    .nav-middle .search-box input { width: 100%; font-size: 14px; }
    #microphone .recoder { width: 90%; height: 350px; padding: 20px; }
    #speakBtn { width: 50px; height: 50px; }
    #speakBtn i { font-size: 28px; }
    }


     .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px); /* For Safari */
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            background: linear-gradient(135deg, rgba(202, 246, 25, 0.9), rgba(1, 205, 205, 0.8));
            animation: bounce 1.2s infinite ease-in-out;
        }

        /* Staggered animation for each dot */
        .dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        .dot:nth-child(4) {
            animation-delay: 0.6s;
        }
        
        /* The bouncing animation keyframes */
        @keyframes bounce {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-8px);
            }
        }

.fourdot .message-content{
    display: flex;
    gap: 6px;
    align-items: center;
    padding:16px 6px;
}

/* Voice Response Indicators */
.voice-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: voicePulse 2s infinite;
}

.voice-indicator.active {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-indicator .voice-icon {
    width: 16px;
    height: 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

.voice-indicator .voice-text {
    flex: 1;
}

.voice-indicator .stop-voice-btn {
    background: rgba(231, 76, 60, 0.8);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.voice-indicator .stop-voice-btn:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.1);
}

.voice-indicator .stop-voice-btn svg {
    width: 12px;
    height: 12px;
    fill: white;
}

@keyframes voicePulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Voice conversation status in chat bubble */
.voice-conversation-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(46, 204, 113, 0.2);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.voice-conversation-badge svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* Enhanced microphone button when voice conversation is active */
#voice_search.voice-active {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
    animation: voiceActivePulse 1.5s infinite;
}

@keyframes voiceActivePulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(46, 204, 113, 0.8);
    }
}

/* About Link */
.about-link-container {
    text-align: center;
    margin-bottom: 20px;
}

#aboutLink, #voiceSettingsLink {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

#aboutLink:hover, #voiceSettingsLink:hover {
    border-color: var(--primary-color);
}

.separator {
    color: var(--text-color);
    margin: 0 10px;
    opacity: 0.7;
}

/* About Modal */
.about-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.about-logo img {
    height: 60px;
}

.about-logo h2 {
    font-size: 2em;
    color: var(--primary-color);
    margin: 0;
}

.about-description {
    font-size: 1em;
    line-height: 1.6;
    color: #ecf0f1;
    margin-bottom: 25px;
}

.about-features h3 {
    font-size: 1.2em;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.about-features ul {
    list-style: none;
    padding: 0;
    text-align: left;
    display: inline-block;
}

.about-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1em;
}

.feature-icon {
    font-size: 1.2em;
}

.about-footer {
    margin-top: 30px;
    font-size: 0.9em;
    color: var(--border-color);
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    .about-modal .custom-alert-content {
        width: 98%;
        max-height: 85vh;
        padding: 15px;
        margin: 5px;
    }
    
    .about-logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .about-logo img {
        height: 40px;
    }
    
}

.about-team {
    margin-top: 25px;
    text-align: left;
}

.about-team h3 {
    font-size: 1.2em;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.about-team .university-name {
    font-style: italic;
    color: #bdc3c7;
    margin-bottom: 15px;
}

.about-team ul {
    list-style: none;
    padding: 0;
}

.about-team li {
    margin-bottom: 8px;
    font-size: 1em;
}

.about-team strong {
    color: var(--primary-color);
}

/* Custom Alert Modal */
.custom-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-alert-modal.visible {
    display: flex;
    opacity: 1;
}

.custom-alert-content {
    position: relative;
    background: linear-gradient(145deg, #3a506b, #2c3e50);
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    border: 1px solid rgba(46, 204, 113, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.custom-alert-modal.visible .custom-alert-content {
    transform: scale(1);
}

.custom-alert-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.custom-alert-close:hover {
    color: #ffffff;
    transform: rotate(90deg);
}

.custom-alert-icon {
    margin: 0 auto 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(241, 196, 15, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-alert-icon svg {
    width: 32px;
    height: 32px;
    fill: #f1c40f;
}

.custom-alert-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
}

.custom-alert-message {
    font-size: 1em;
    line-height: 1.6;
    color: #ecf0f1;
}

