/* =========================================== */
/* RIPPERIUM AI - ULTIMATE STYLING             */
/* =========================================== */

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00d4ff;
    --primary-dark: #0099ff;
    --secondary: #ff00cc;
    --secondary-dark: #cc00a3;
    --accent: #00ff88;
    --danger: #ff5555;
    --warning: #ffaa00;
    
    --bg-dark: #0a0a1a;
    --bg-darker: #050510;
    --bg-card: rgba(16, 18, 27, 0.95);
    --bg-card-light: rgba(255, 255, 255, 0.08);
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    
    --text-primary: #ffffff;
    --text-secondary: #e0e0ff;
    --text-muted: #8a8aff;
    
    --border-radius: 20px;
    --border-radius-sm: 12px;
    --border-radius-lg: 30px;
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px rgba(0, 212, 255, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 204, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ============ CONTAINER & LAYOUT ============ */
.container {
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
    height: 100vh;
    position: relative;
    backdrop-filter: blur(10px);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ============ HEADER STYLES ============ */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    position: relative;
    animation: slideDown 0.5s ease;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Menu Button */
.menu-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.menu-btn::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: var(--transition-slow);
}

.menu-btn:hover {
    transform: translateY(-2px) rotate(5deg);
    box-shadow: var(--shadow-glow);
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn.active {
    background: linear-gradient(45deg, var(--secondary), var(--secondary-dark));
}

.menu-icon, .close-icon {
    width: 24px;
    height: 24px;
    transition: var(--transition);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    transform: translateX(5px);
}

.logo img {
    height: 48px;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
    animation: float 6s ease-in-out infinite;
}

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

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--accent);
}

/* Model Indicator */
.model-indicator {
    background: rgba(0, 212, 255, 0.1);
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.model-indicator:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.model-indicator .svg-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}

.model-indicator span {
    color: var(--text-primary);
    font-weight: 700;
}

.model-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
}

/* ============ SIDEBAR STYLES ============ */
.sidebar {
    width: 380px;
    background: rgba(10, 12, 23, 0.98);
    backdrop-filter: blur(25px) saturate(200%);
    border-right: 2px solid var(--primary);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 900;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding-bottom: 1.8rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    position: relative;
}

.sidebar-header h2 {
    font-size: 1.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
}

.sidebar-header .svg-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.history-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Custom Scrollbar */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: var(--transition);
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--primary-dark), var(--secondary-dark));
}

/* History Items */
.history-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.history-item:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(10px) translateY(-2px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-sm);
}

.history-item:hover::before {
    opacity: 1;
}

.history-item:hover .history-icon {
    transform: scale(1.2) rotate(10deg);
}

.history-icon {
    font-size: 1.4rem;
    color: var(--primary);
    transition: var(--transition);
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 50%;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1rem;
}

.history-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-date::before {
    content: '🕒';
    font-size: 0.8rem;
}

.delete-history {
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
    color: var(--danger);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    padding: 0.6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.history-item:hover .delete-history {
    opacity: 1;
}

.delete-history:hover {
    background: rgba(255, 85, 85, 0.2);
    transform: scale(1.1);
    border-color: var(--danger);
}

.delete-history .svg-icon {
    width: 16px;
    height: 16px;
}

.history-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.history-empty::before {
    content: '💬';
    font-size: 3rem;
    opacity: 0.5;
}

.sidebar-footer {
    padding-top: 1.8rem;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.btn-clear {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(45deg, var(--danger), #ff416c);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.btn-clear::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-clear:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 65, 108, 0.4);
}

.btn-clear:hover::before {
    width: 300px;
    height: 300px;
}

.btn-clear:active {
    transform: translateY(-1px);
}

.btn-clear .svg-icon {
    width: 20px;
    height: 20px;
    color: white;
}

/* ============ CHAT AREA STYLES ============ */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 1.5rem;
    margin-bottom: 2rem;
    scroll-behavior: smooth;
}

/* Chat Scrollbar */
.chat-container::-webkit-scrollbar {
    width: 10px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin: 5px 0;
}

.chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--primary-dark), var(--secondary-dark));
}

/* Message Styles */
.message {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    animation: messageAppear 0.4s ease-out;
}

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

.message.user-message {
    flex-direction: row-reverse;
}

/* Avatar */
.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.message:hover .avatar {
    transform: scale(1.05);
}

.user-message .avatar {
    background: linear-gradient(45deg, var(--secondary), var(--secondary-dark));
}

.ai-message .avatar {
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
}

.avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.message:hover .avatar::after {
    opacity: 1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.avatar .svg-icon {
    width: 28px;
    height: 28px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Message Content */
.message-content {
    max-width: 70%;
    background: var(--bg-card-light);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.message:hover .message-content {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 212, 255, 0.2);
}

.user-message .message-content {
    background: linear-gradient(45deg, rgba(255, 0, 204, 0.15), rgba(255, 0, 102, 0.1));
    border-color: rgba(255, 0, 204, 0.3);
    border-top-right-radius: 5px;
}

.ai-message .message-content {
    border-top-left-radius: 5px;
    border-top-right-radius: var(--border-radius);
}

.user-message .message-content {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: 5px;
}

.message-sender {
    font-weight: 800;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.ai-message .message-sender {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.user-message .message-sender {
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(255, 0, 204, 0.3);
}

.model-badge {
    display: inline-block;
    background: linear-gradient(45deg, rgba(0, 212, 255, 0.2), rgba(255, 0, 204, 0.2));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.message-text {
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.message-text p {
    margin-bottom: 1rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong {
    color: var(--primary);
    font-weight: 800;
}

.message-text em {
    color: var(--text-muted);
    font-style: italic;
}

.message-text a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
    transition: var(--transition-fast);
}

.message-text a:hover {
    color: var(--secondary);
    border-bottom-style: solid;
}

/* Code Blocks */
.inline-code {
    background: rgba(0, 212, 255, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.95rem;
    color: var(--primary);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.code-block {
    display: block;
    background: rgba(10, 12, 23, 0.9);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.code-block::before {
    content: attr(class);
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-bottom-left-radius: 6px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
}

.message-timestamp {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.8rem;
    text-align: right;
    opacity: 0.7;
    transition: var(--transition);
}

.message:hover .message-timestamp {
    opacity: 1;
}

/* Image in Chat */
.chat-image {
    margin-top: 1.2rem;
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.chat-image:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.chat-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius-sm);
    display: block;
    border: 2px solid rgba(0, 212, 255, 0.3);
}

/* Typing Indicator */
.typing-indicator {
    opacity: 0.9;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.7; }
}

.typing-dots {
    display: flex;
    gap: 8px;
    padding: 1.2rem 0;
}

.typing-dots .dot {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.typing-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dots .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { 
        transform: scale(0.5); 
        opacity: 0.3;
    }
    40% { 
        transform: scale(1.2); 
        opacity: 1;
    }
}

/* ============ INPUT AREA ============ */
.input-area {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 2px solid rgba(0, 212, 255, 0.2);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 100;
}

.input-area::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
    border-radius: var(--border-radius-lg);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.input-area:focus-within::before {
    opacity: 0.3;
    animation: gradientRotate 3s linear infinite;
}

@keyframes gradientRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Attach Button */
.btn-attach {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--secondary), var(--secondary-dark));
    color: white;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-attach:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 30px var(--secondary);
}

.btn-attach:active {
    transform: scale(0.95);
}

.btn-attach .svg-icon {
    width: 28px;
    height: 28px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Input Wrapper */
.input-wrapper {
    flex: 1;
    display: flex;
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--border-radius);
    padding: 0.8rem;
    border: 1px solid rgba(0, 212, 255, 0.15);
    transition: var(--transition);
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 1.15rem;
    outline: none;
    font-family: 'Exo 2', sans-serif;
    resize: none;
    min-height: 60px;
    max-height: 120px;
    line-height: 1.6;
}

#messageInput::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.input-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-left: 0.8rem;
}

/* Model Button */
.btn-emoji {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.3);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-emoji:hover {
    background: rgba(0, 212, 255, 0.2);
    transform: scale(1.1) rotate(15deg);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-emoji .svg-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    transition: var(--transition);
}

.btn-emoji:hover .svg-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

/* Send Button */
.btn-send {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-send:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--primary);
}

.btn-send:active {
    transform: scale(0.95);
}

.btn-send::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition-slow);
}

.btn-send:hover::before {
    left: 100%;
}

.btn-send .svg-icon {
    width: 24px;
    height: 24px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.btn-send:hover .svg-icon {
    transform: translateX(3px) translateY(-3px);
}

/* ============ MODEL DROPDOWN ============ */
.model-dropdown {
    position: absolute;
    bottom: 130px;
    right: 30px;
    width: 380px;
    background: rgba(10, 12, 23, 0.98);
    backdrop-filter: blur(25px) saturate(200%);
    border-radius: var(--border-radius);
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-lg);
    padding: 1.8rem;
    display: none;
    z-index: 1000;
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.model-dropdown.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.dropdown-header h3 {
    color: var(--primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
}

.dropdown-header .svg-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.btn-close-dropdown {
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-close-dropdown:hover {
    background: rgba(255, 85, 85, 0.2);
    transform: rotate(90deg);
    border-color: var(--danger);
}

.btn-close-dropdown .svg-icon {
    width: 20px;
    height: 20px;
}

.model-list {
    list-style: none;
}

.model-option {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.model-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 212, 255, 0.1), rgba(255, 0, 204, 0.1));
    opacity: 0;
    transition: var(--transition);
}

.model-option:hover {
    transform: translateX(10px);
    border-color: rgba(0, 212, 255, 0.3);
}

.model-option:hover::before {
    opacity: 1;
}

.model-option.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.model-option .svg-icon:first-child {
    width: 28px;
    height: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
    z-index: 1;
}

.model-option span {
    flex: 1;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
    z-index: 1;
}

.model-option .model-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
}

.check-icon {
    color: var(--accent);
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.5));
    animation: bounceIn 0.5s ease;
    z-index: 1;
}

@keyframes bounceIn {
    0% { transform: scale(0) rotate(45deg); }
    50% { transform: scale(1.2) rotate(45deg); }
    100% { transform: scale(1) rotate(45deg); }
}

/* ============ IMAGE PREVIEW ============ */
.image-preview {
    position: fixed;
    bottom: 130px;
    left: 30px;
    background: rgba(10, 12, 23, 0.98);
    border-radius: var(--border-radius);
    border: 2px solid var(--primary);
    padding: 1.2rem;
    max-width: 320px;
    display: none;
    z-index: 900;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(25px);
    animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.image-preview.active {
    display: block;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

#removeImage {
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

#removeImage:hover {
    background: rgba(255, 85, 85, 0.2);
    transform: scale(1.1);
    border-color: var(--danger);
}

#removeImage .svg-icon {
    width: 18px;
    height: 18px;
}

#previewImage {
    max-width: 100%;
    max-height: 250px;
    border-radius: var(--border-radius-sm);
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

#previewImage:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* ============ FOOTER ============ */
.app-footer {
    text-align: center;
    padding: 1.8rem;
    background: rgba(10, 12, 23, 0.9);
    border-top: 2px solid var(--primary);
    color: var(--text-muted);
    font-size: 0.95rem;
    backdrop-filter: blur(20px);
    position: relative;
}

.app-footer p {
    margin-bottom: 0.5rem;
}

.app-footer strong {
    color: var(--primary);
    font-weight: 700;
}

.footer-note {
    font-size: 0.85rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.footer-note::before {
    content: '🛡️';
    font-size: 0.9rem;
}

/* ============ ERROR MESSAGES ============ */
.error-message {
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 1.2rem;
    margin: 1rem 0;
    text-align: center;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-message .error-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--danger);
    font-weight: 600;
}

/* ============ DRAG & DROP ============ */
.drag-over {
    outline: 4px dashed var(--primary);
    outline-offset: -10px;
    background: rgba(0, 212, 255, 0.05) !important;
    animation: pulseOutline 2s infinite;
}

@keyframes pulseOutline {
    0%, 100% { outline-color: var(--primary); }
    50% { outline-color: var(--secondary); }
}

/* ============ LOADING ANIMATIONS ============ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ RESPONSIVE DESIGN ============ */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .chat-area {
        padding: 2rem;
    }
    
    .sidebar {
        width: 350px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        position: absolute;
        height: calc(100% - 80px);
        top: 80px;
        z-index: 999;
        box-shadow: var(--shadow-lg);
    }
    
    .model-dropdown {
        width: 320px;
        right: 20px;
        bottom: 120px;
    }
    
    .image-preview {
        max-width: 280px;
        left: 20px;
    }
    
    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem 1.5rem;
    }
    
    .logo-text {
        font-size: 1.8rem;
    }
    
    .logo img {
        height: 36px;
    }
    
    .menu-btn {
        width: 48px;
        height: 48px;
    }
    
    .model-indicator {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .chat-area {
        padding: 1.5rem;
    }
    
    .message {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .avatar {
        width: 48px;
        height: 48px;
    }
    
    .message-content {
        max-width: 85%;
        padding: 1.2rem 1.5rem;
    }
    
    .input-area {
        padding: 1.2rem;
        gap: 1rem;
    }
    
    .btn-attach, .btn-send {
        width: 52px;
        height: 52px;
    }
    
    .btn-emoji {
        width: 48px;
        height: 48px;
    }
    
    #messageInput {
        font-size: 1rem;
        min-height: 52px;
    }
    
    .model-dropdown {
        width: 280px;
        right: 10px;
        bottom: 110px;
        padding: 1.5rem;
    }
    
    .model-option {
        padding: 1rem;
    }
    
    .image-preview {
        max-width: 240px;
        left: 10px;
        bottom: 110px;
    }
    
    .chat-image img {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .header-left {
        gap: 1rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .logo img {
        height: 32px;
    }
    
    .model-indicator span:last-child {
        display: none;
    }
    
    .chat-area {
        padding: 1rem;
    }
    
    .message {
        flex-direction: column !important;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .user-message .avatar {
        align-self: flex-end;
    }
    
    .message-content {
        max-width: 95%;
        width: 100%;
    }
    
    .input-area {
        flex-direction: column;
        gap: 1rem;
    }
    
    .input-wrapper {
        width: 100%;
    }
    
    .btn-attach {
        align-self: flex-start;
    }
    
    .sidebar {
        width: 100%;
        padding: 1.5rem;
    }
    
    .model-dropdown {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .image-preview {
        width: calc(100% - 40px);
        left: 20px;
        max-width: none;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    .app-header,
    .sidebar,
    .input-area,
    .model-dropdown,
    .image-preview,
    .app-footer,
    .menu-btn,
    .btn-attach,
    .btn-emoji,
    .btn-send {
        display: none !important;
    }
    
    .chat-area {
        padding: 0;
    }
    
    .chat-container {
        overflow: visible;
        padding: 0;
    }
    
    .message {
        break-inside: avoid;
        margin-bottom: 1.5rem;
    }
    
    .message-content {
        background: white !important;
        color: black !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}