/* --- aistudio_Style.css --- */

:root {
    /* --- Color Palette (Dark Theme) --- */
    --bg-primary: #17181a;       /* Main background */
    --bg-secondary: #202225;     /* Cards, Sidebar, Headers */
    --bg-tertiary: #2c2f33;      /* Inputs, Hover states */
    --bg-hover: #35383c;         /* Active/Hover items */
    
    --text-primary: #f0f2f5;     /* Main text */
    --text-secondary: #a8b3cf;   /* Subtitles, icons */
    --text-muted: #72767d;       /* Disabled text */
    
    --text-active: #82aaff;      /* Primary Accent (Blue/Purple) */
    --accent-color: #4CAF50;     /* Success/Green (kept from original branding) */
    --error-color: #ff8a80;      /* Error/Red */
    
    --border-color: #3a3d42;     /* Dividers */
    
    /* --- Dimensions --- */
    --sidebar-width: 260px;
    --header-height: 60px;
    
    /* --- Typography --- */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Base & Reset --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}

html, body { 
    height: 100%; 
    background-color: var(--bg-primary); 
    color: var(--text-primary); 
    font-family: var(--font-family); 
    font-size: 16px; 
    overflow: hidden; /* Prevent body scroll, handle inside containers */
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* --- Material Symbols Icon Settings --- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    font-size: 24px;
    user-select: none;
}

/* --- Main Layout Structure --- */
.app-container { 
    display: flex; 
    width: 100%; 
    height: 100%; 
}

.main-wrapper { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    position: relative;
    overflow: hidden;
}

/* --- Sidebar Navigation --- */
#left-sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Header */
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-active);
    letter-spacing: 0.5px;
}

/* Sidebar Links */
.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-nav { padding: 10px; }

.sidebar-nav a, 
.sidebar-nav button {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-align: left;
}

.sidebar-nav a:hover, 
.sidebar-nav button:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background-color: rgba(130, 170, 255, 0.1);
    color: var(--text-active);
}

.sidebar-nav a.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

/* --- Top Header (Mobile & Desktop) --- */
.main-header {
    height: var(--header-height);
    background-color: rgba(32, 34, 37, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.icon-button {
    padding: 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* --- Content Area --- */
.content-area {
    flex: 1;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

.content-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100%;
}

/* --- Components: Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--text-active);
    color: var(--bg-primary);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-secondary);
}

/* --- Components: Inputs & Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

input, textarea, .prompt-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, .prompt-input:focus {
    border-color: var(--text-active);
}

.prompt-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bg-secondary);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.prompt-input-wrapper .prompt-input {
    background: transparent;
    border: none;
    padding: 8px;
}

.prompt-input-wrapper .prompt-input:focus {
    box-shadow: none;
}

.send-button {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-button.active, .send-button:hover {
    background: var(--text-active);
    color: var(--bg-primary);
}

/* --- Components: Cards (Feed, Profile) --- */
.profile-card, .post-card, .suggestion-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* --- Authentication View --- */
.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.auth-view { display: none; }
.auth-view.active { display: block; }

/* --- Mobile Responsive Logic --- */

/* Overlay for mobile sidebar */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}

/* Desktop View (Sidebar visible) */
@media (min-width: 1024px) {
    #left-sidebar {
        position: static;
        transform: none;
    }
    #menu-toggle {
        display: none;
    }
}

/* Mobile View (Sidebar hidden off-canvas) */
@media (max-width: 1023px) {
    #left-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 12px rgba(0,0,0,0.3);
    }

    body.left-sidebar-open #left-sidebar {
        transform: translateX(0);
    }

    body.left-sidebar-open .overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* --- Utilities --- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }

/* --- Chat Specifics --- */
.chat-message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    margin-bottom: 8px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.ai-message { /* Received */
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-message { /* Sent */
    background-color: var(--text-active);
    color: var(--bg-primary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}