:root {
    --primary: #1DB9FF;
    --dark: #0f172a;
    --surface: #1e293b;
    --text: #e2e8f0;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%; /* Ensure the body covers the entire viewport height */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Modern and clean font stack */
}

/* Background styles */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.background-overlay {
    position: fixed; /* Fixed to stay in place while scrolling */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.7) 100%);
    z-index: -1; /* Ensure it stays behind other content but above the background image */
}

/* Fixed navigation bar styles */
.fixed-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center; /* Center the content */
    align-items: center;
    background: rgba(30, 41, 59, 0.95); /* Increased opacity for better readability */
    backdrop-filter: blur(8px);
    padding: 10px 15px; /* Reduced padding for mobile */
    color: white;
    z-index: 2; /* Ensure it stays above other content */
    box-sizing: border-box;
}

.nav-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
    padding: 0 15px;
}

.fixed-bar a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fixed-bar a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.fixed-bar a:hover {
    background: rgba(29, 185, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(29, 185, 255, 0.5);
    box-shadow: 0 5px 15px rgba(29, 185, 255, 0.2);
}

.fixed-bar a:hover::before {
    left: 100%;
}

.fixed-bar a i {
    font-size: 1.1rem;
    background: linear-gradient(135deg, #1DB9FF, #3CFFE6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease;
}

.fixed-bar a:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Custom colors for different nav items */
.fixed-bar a[href="#about"] i {
    background-image: linear-gradient(135deg, #FF6B6B, #FFE66D);
}

.fixed-bar a[href="#contact"] i {
    background-image: linear-gradient(135deg, #4ECDC4, #45B7D1);
}

.fixed-bar a[href="/chat"] i {
    background-image: linear-gradient(135deg, #A8E6CF, #3CFFE6);
}

.fixed-bar a[href*="login"] i {
    background-image: linear-gradient(135deg, #1DB9FF, #3CFFE6);
}

/* Landing section styles */
.landing-container {
    position: relative; /* Required to position content above background */
    z-index: 1; /* Ensure it's above the background */
    text-align: center;
    color: white;
    animation: fadeIn 3s ease-in-out;
    margin-top: -40px; /* Add margin to avoid overlap */
    background: linear-gradient(135deg, var(--dark), var(--surface));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 60px; /* Increased top padding to account for fixed navbar */
}

.landing-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    margin-top: -20px; /* Added negative margin */
}

.landing-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1DB9FF, #3CFFE6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0 15px;
    text-align: center;
    position: relative;
    animation: glow 2s ease-in-out infinite alternate;
    text-shadow: none;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 2px rgba(29, 185, 255, 0.4))
               drop-shadow(0 0 4px rgba(29, 185, 255, 0.3));
    }
    to {
        filter: drop-shadow(0 0 4px rgba(29, 185, 255, 0.6))
               drop-shadow(0 0 8px rgba(29, 185, 255, 0.5));
    }
}

.landing-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 2px;
}

.landing-title i {
    font-size: 3rem;
}

.landing-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #ffffff;
    margin-bottom: 40px;
    text-shadow: 1px 1px 3px rgb(0, 0, 0);
    opacity: 0; /* Start hidden */
    animation: fadeInUp 2s ease-in-out 1s forwards; /* 1s delay before animation starts */
    padding: 0 15px;
    text-align: center;
    margin-top: -10px; /* Added negative margin */
    min-height: 3.6em; /* Add fixed height for two lines of text */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

#typed-text {
    display: block;
    min-height: 2.4em; /* Height for two lines */
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-button {
    padding: 15px 30px;
    font-size: 1.2rem;
    color: var(--dark);
    background: var(--primary);
    border: none;
    border-radius: 10px; /* Changed to rectangle with rounded corners */
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-top: 10px; /* Adjusted margin */
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 185, 255, 0.3);
}

.logo {
    margin-top: 0px; /* Reduced top margin */
    width: 180px; /* Smaller logo for mobile */
    height: auto;
    max-width: 80%; /* Ensure logo doesn't overflow */
    margin-bottom: 0px; /* Space between logo and title */
    animation: fadeIn 1s ease-in-out, floatAnimation 3s ease-in-out infinite;
    box-shadow: #000000;
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Section styles */
.about-section, .contact-section {
    background: rgba(30, 82, 90, 0.8); /* Dark background for contrast */
    color: white;
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    margin: 30px; /* Space around the sections */
}

.about-section h2, .contact-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.about-section p, .contact-section p {
    font-size: 1.2rem;
    margin: 10px 0;
}

.contact-section a {
    color: #ffffff;
    text-decoration: underline;
}

/* Dark mode toggle button */
#toggle-dark-mode {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background-color: rgba(30, 41, 59, 0.8);
    color: var(--primary);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#toggle-dark-mode:hover {
    background-color: rgba(30, 41, 59, 1);
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 0 20px rgba(29, 185, 255, 0.3);
}

/* Dark mode styles */
.dark-mode {
    background-color: #1c1c1c;
    color: white;
}

.dark-mode .background {
    background: url('dark-background.png') no-repeat center center;
    background-size: cover;
}

.dark-mode .about-section,
.dark-mode .contact-section {
    background: rgba(0, 0, 0, 0.8);
}

.dark-mode .start-button {
    background-color: #444444;
    color: #ffffff;
}

.dark-mode .footer {
    color: #ffffff;
}

.dark-mode .landing-title {
    background: linear-gradient(135deg, #1DB9FF, #FFFFFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.dark-mode .fixed-bar {
    background: rgba(15, 23, 42, 0.95);
}

/* Footer styles */
.footer {
    width: 100%;
    text-align: center;
    color: rgb(0, 0, 0);
    font-size: 1rem;
    padding: 10px 0;
    background-color: transparent; /* Removed background color */
    margin-top: 20px; /* Space between contact section and footer */
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Media queries for mobile view */
@media (max-width: 768px) {
    .landing-title {
        font-size: clamp(2rem, 5vw, 3rem);
        letter-spacing: 1px;
    }
    
    .landing-title::after {
        width: 40px;
        height: 2px;
    }

    .landing-subtitle {
        font-size: 1.5rem;
        min-height: 4.5em; /* Slightly taller for mobile */
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    #typed-text {
        min-height: 3em;
    }

    .start-button {
        font-size: 1rem;
        padding: 8px 16px;
    }

    .about-section, .contact-section {
        padding: 20px;
        margin: 20px;
    }

    .about-section h2, .contact-section h2 {
        font-size: 2rem;
    }

    .about-section p, .contact-section p {
        font-size: 1rem;
    }

    .fixed-bar a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .fixed-bar a i {
        font-size: 1rem;
    }

    .nav-buttons {
        gap: 10px;
    }
    
    .fixed-bar a {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .fixed-bar {
        padding: 8px 5px;
    }

    .nav-buttons {
        gap: 8px;
    }

    .fixed-bar a {
        padding: 5px 10px;
        font-size: 0.85rem;
    }

    .fixed-bar a i {
        font-size: 0.9rem;
    }

    .landing-container {
        padding-top: 40px; /* Reduced padding for mobile */
        margin-top: -20px; /* Adjusted for mobile */
    }

    .logo {
        margin-top: 0;
        width: 150px;
    }
}

/* Extra small screen optimization */
@media (max-width: 380px) {
    .nav-buttons {
        gap: 6px;
    }

    .fixed-bar a {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    .logo {
        width: 120px;
    }

    .landing-title i {
        font-size: 2rem;
    }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns for desktop */
    gap: 40px;
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 40px;
    justify-content: center;
}

.feature-card {
    background: var(--surface);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, var(--surface), rgba(30, 41, 59, 0.8));
}

.feature-card::before {
    content: '';
    position: absolute;
    top: var(--mouse-y, 0);
    left: var(--mouse-x, 0);
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(29, 185, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

/* Update feature card icon styles */
.feature-card i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    position: relative;
    display: inline-block;
}

/* Base gradient styles for icons */
.feature-card i::before {
    background: linear-gradient(135deg, #1DB9FF, #3CFFE6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glow 2s ease-in-out infinite alternate;
}

/* Custom gradients for each icon */
.feature-card i.fa-map-marked-alt::before {
    background-image: linear-gradient(135deg, #FF6B6B, #FFE66D);
}

.feature-card i.fa-search-location::before {
    background-image: linear-gradient(135deg, #4ECDC4, #45B7D1);
}

.feature-card i.fa-clock::before {
    background-image: linear-gradient(135deg, #A8E6CF, #3CFFE6);
}

.feature-card i.fa-code-branch::before {
    background-image: linear-gradient(135deg, #1DB9FF, #3CFFE6);
}

.feature-card:hover i {
    transform: scale(1.2) rotate(5deg);
}

.feature-card h3 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.6;
}

.about-description {
    max-width: 800px;
    margin: 40px auto 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.about-description p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}

/* Update media queries for better mobile responsiveness */
@media (max-width: 768px) {
    .about-section {
        padding: 40px 20px;
        margin: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr; /* Single column for mobile */
        gap: 20px;
        padding: 0 20px;
    }

    .feature-card {
        min-height: auto;
        padding: 20px;
    }

    .about-description {
        padding: 15px;
    }

    .about-description p {
        font-size: 1rem;
    }
}

/* Ensure even spacing in desktop view */
@media (min-width: 769px) {
    .feature-card {
        min-height: 300px; /* Ensure all cards have same height */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
    }
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateX(10px);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary);
}

.section-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.section-icon i {
    animation: pulseAnimation 2s infinite;
}

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

.right-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.map-icon {
    font-size: 3rem;
    color: var(--primary);
}

@media (min-width: 769px) {
    .landing-title-container {
        flex-direction: row;
    }
}

html {
    scroll-behavior: smooth;
}