@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #050505;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background Shapes */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: drift 10s infinite alternate ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.4); /* Blue */
    top: -10%;
    left: -10%;
}

.shape-2 {
    width: 350px;
    height: 350px;
    background: rgba(139, 92, 246, 0.4); /* Purple */
    bottom: 10%;
    right: -5%;
    animation-delay: 2s;
}

@keyframes drift {
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Navigation */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { font-weight: 800; font-size: 1.5rem; }
.logo span { color: #8b5cf6; }

.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a { color: #a3a3a3; text-decoration: none; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: #fff; }

/* 3D Hero Section */
.hero-section {
    min-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    padding: 20px;
}

.container-3d {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The actual 3D Card */
.card-3d {
    width: 100%;
    padding: 60px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
    transform-style: preserve-3d;
    transition: transform 0.1s ease, box-shadow 0.3s ease;
    cursor: grab;
}

/* Popping elements inside the 3D card */
.card-content {
    transform: translateZ(60px);
}

.title-3d {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 20px;
    transform: translateZ(80px);
    text-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.highlight {
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: #a3a3a3;
    max-width: 500px;
    margin-bottom: 30px;
    transform: translateZ(40px);
}

.tech-stack {
    display: flex;
    gap: 15px;
    transform: translateZ(50px);
}

.tech-stack span {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Projects Section */
.projects-section {
    padding: 100px 5%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: transform 0.4s ease, background 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-15px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-card h3 {
    color: #8b5cf6;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.glass-card p {
    color: #a3a3a3;
    line-height: 1.6;
}

/* Mobile Responsiveness for 3D UI */
@media (max-width: 768px) {
    .card-3d { padding: 40px 20px; }
    .hero-section { min-height: 70vh; }
    .tech-stack { flex-wrap: wrap; }
}

.magic-text {
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(79, 172, 254, 0.3);
}

/* Auth Screen Styles */
.flex-center { display: flex; justify-content: center; align-items: center; height: 100vh; }
.text-center { text-align: center; }

.auth-card {
    width: 90%;
    max-width: 400px;
    padding: 40px;
}

.auth-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.auth-inputs input {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s ease;
}

.auth-inputs input:focus {
    border: 1px solid #4facfe;
}

.full-width {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}

.toggle-text {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #a3a3a3;
}

.highlight-text {
    color: #4facfe;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s;
}

.highlight-text:hover {
    color: #00f2fe;
}

/* =========================================
   AI CHAT ROOM STYLES (BORDERLESS & CLEAN)
   ========================================= */

/* Top Navigation in Chat */
.chat-nav { justify-content: space-between; padding: 15px 5%; }
.warning-badge { background: rgba(239, 68, 68, 0.2); color: #ef4444; padding: 5px 12px; border-radius: 15px; font-size: 0.9rem; border: 1px solid rgba(239, 68, 68, 0.3); }

.action-btn { 
    background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255, 255, 255, 0.2); 
    padding: 8px 15px; border-radius: 8px; cursor: pointer; margin-left: 10px; transition: 0.3s;
}
.action-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* Chat Container (No borders, no hover jump) */
.chat-container { 
    width: 90%; 
    max-width: 900px; 
    height: 80vh; 
    margin: 20px auto; 
    display: flex; 
    flex-direction: column; 
    padding: 20px; 
    border: none !important;
    box-shadow: none !important;
    background: transparent;
}

.chat-container.glass-card:hover {
    transform: none;
    background: transparent;
    border: none;
}

.chat-box { flex: 1; overflow-y: auto; padding-right: 10px; display: flex; flex-direction: column; gap: 15px; }

/* Messages formatting */
.message { 
    max-width: 85%; 
    padding: 12px 18px; 
    line-height: 1.6; 
    font-size: 1.05rem; 
    border: none !important;
}

.message-content { white-space: pre-wrap; word-wrap: break-word; }

/* User Message Bubble */
.user-msg { 
    align-self: flex-end; 
    background: #2a2a2a; 
    color: #f1f1f1; 
    border-radius: 20px; 
    border-bottom-right-radius: 4px; 
}

/* AI Message (Plain text look like Gemini) */
.ai-msg { 
    align-self: flex-start; 
    background: transparent; 
    color: #ffffff; 
    padding: 12px 0; 
}

/* Input Area (Pill shape, no borders) */
.input-area { 
    display: flex; 
    gap: 15px; 
    margin-top: 20px; 
    background: #1e1e1e;
    border-radius: 25px;
    padding: 5px 10px;
    align-items: center;
}

#user-input {
    flex: 1;
    background: transparent;
    color: white;
    border: none !important;
    box-shadow: none !important;
    padding: 15px;
    resize: none; /* User ah manual ah resize panna vidaadhu */
    height: 50px; /* Initial height */
    max-height: 150px; /* Max ah ivlo dhaan perusaaganum */
    font-family: inherit;
    outline: none;
    overflow-y: hidden; /* Indha line dhaan scrollbar ah thookum */
    transition: height 0.2s ease; /* Height change aagumbodu smooth ah irukum */
}

.glow-btn { 
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%); color: white; border: none; 
    padding: 10px 25px; border-radius: 10px; cursor: pointer; font-weight: bold; box-shadow: 0 0 15px rgba(79, 172, 254, 0.4); 
}

#send-btn {
    height: 45px;
    border-radius: 20px;
    margin-right: 5px;
}

/* Scrollbar styling */
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

/* Mobile responsiveness for Chat */
@media (max-width: 768px) {
    .chat-nav { flex-direction: column; gap: 15px; text-align: center; }
    .chat-container { height: 85vh; width: 95%; margin: 10px auto; padding: 10px; }
    .input-area { border-radius: 20px; padding: 5px; }
}
/* =========================================
   TYPING INDICATOR ANIMATION
   ========================================= */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 0;
    align-items: center;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #a3a3a3;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
/* =========================================
   GREETING MESSAGE (GEMINI STYLE)
   ========================================= */
.greeting-message {
    margin: auto; /* Chat box-kulla center-ah nikka vekum */
    width: 100%;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* Text-a left side align pannum */
    padding-bottom: 50px; /* Input box-ku mela konjam gap */
}

.greet-name {
    font-size: 2rem;
    font-weight: 500;
    /* Image-la iruka antha grey color */
    background: linear-gradient(90deg, #c4c7c5, #8a8d8b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.greet-text {
    font-size: 2.8rem;
    font-weight: 500;
    color: #e3e3e3; /* Bright white/grey */
    letter-spacing: -0.5px;
}

/* Mobile ku chinna text */
@media (max-width: 768px) {
    .greet-name { font-size: 1.5rem; }
    .greet-text { font-size: 2rem; }
}
/* =========================================
   SIDEBAR & HISTORY STYLES
   ========================================= */
.sidebar {
    position: fixed;
    left: -320px; /* Hide by default */
    top: 0;
    width: 300px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease-in-out;
    z-index: 2000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
}

.sidebar.active {
    left: 0; /* Slide in pannum */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: #4facfe;
    font-weight: bold;
}

.icon-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.3s;
}

.icon-btn:hover { 
    color: #cf30aa; 
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 5px;
}

/* Scrollbar for history list */
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }

.history-item {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Long text vandha ... nu varum */
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: #e3e3e3;
}

.history-item:hover {
    background: rgba(79, 172, 254, 0.1);
    border: 1px solid rgba(79, 172, 254, 0.3);
}

.history-item.active-chat {
    background: rgba(207, 48, 170, 0.15);
    border: 1px solid rgba(207, 48, 170, 0.5);
    color: white;
    font-weight: 500;
}
