* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #212121;
    --bg-secondary: #171717;
    --bg-tertiary: #2a2a2a;
    --bg-hover: #353535;
    --bg-active: #3a3a3a;
    --text-primary: #ececec;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --accent-primary: #10a37f;
    --accent-hover: #0d8f6e;
    --border-color: #2f2f2f;
    --sidebar-width: 260px;
}

/* Theme: Night (Dark Purple) */
[data-theme="night"] {
    --bg-primary: #1a1625;
    --bg-secondary: #0f0b1a;
    --bg-tertiary: #241f2e;
    --bg-hover: #2d2538;
    --bg-active: #352d42;
    --text-primary: #e8e4f0;
    --text-secondary: #a89bb8;
    --text-tertiary: #7a6b94;
    --border-color: #2a2435;
}

/* Theme: High Contrast */
[data-theme="high-contrast"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --bg-hover: #2a2a2a;
    --bg-active: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #999999;
    --border-color: #333333;
    --accent-primary: #00ff00;
    --accent-hover: #00cc00;
}

/* Theme: Light */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --bg-hover: #e0e0e0;
    --bg-active: #d5d5d5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #d0d0d0;
    --accent-primary: #0066cc;
    --accent-hover: #0052a3;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Side Navigation */
.side-nav {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-nav::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.side-nav::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

.nav-section {
    margin-bottom: 1rem;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.nav-btn:hover {
    background-color: var(--bg-hover);
    transform: translateX(2px);
}

.nav-btn:active {
    transform: translateX(0);
    background-color: var(--bg-active);
}

.nav-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.new-chat-btn {
    background-color: var(--bg-tertiary);
    font-weight: 500;
}

.new-chat-btn:hover {
    background-color: var(--bg-hover);
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.chat-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(2px);
}

.chat-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.chat-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-section {
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.account-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.account-info:hover {
    background-color: var(--bg-hover);
}

.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #0d8f6e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-account-link {
    text-decoration: none;
    color: inherit;
}

.login-account-link:hover {
    background-color: var(--bg-hover);
}

.account-details {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-status {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    overflow: hidden;
    position: relative;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    z-index: 10;
}

.model-selector-header {
    display: flex;
    align-items: center;
}

.model-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-btn:hover {
    background-color: var(--bg-hover);
}

.model-btn svg {
    opacity: 0.7;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-btn:hover svg {
    transform: translateY(1px);
}

.model-selector-wrapper {
    position: relative;
}

.model-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    animation: slideDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-dropdown.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.model-option {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.model-option:hover {
    background: var(--bg-hover);
}

.model-option span:first-child {
    font-weight: 500;
    font-size: 0.875rem;
}

.model-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Creative Modal */
.creative-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10003;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s;
    backdrop-filter: blur(4px);
}

.creative-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.creative-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.creative-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.creative-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.creative-modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.creative-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.form-group textarea {
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.form-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.form-btn.primary {
    background: var(--accent-primary);
    color: white;
}

.form-btn.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.form-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-btn.secondary:hover {
    background: var(--bg-hover);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

.login-btn-header {
    width: auto;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.login-btn-header span {
    display: none;
}

@media (min-width: 768px) {
    .login-btn-header span {
        display: inline;
    }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0.75rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 768px;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
    transform: translateY(-1px);
}

.attach-btn,
.mic-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.attach-btn:hover,
.mic-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    outline: none;
    line-height: 1.5;
    padding: 0.25rem 0;
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 2px;
}

.send-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.send-btn.active {
    opacity: 1;
}

.send-btn:hover {
    background-color: var(--accent-hover);
    transform: scale(1.1) rotate(15deg);
}

.send-btn:active {
    transform: scale(0.95) rotate(0deg);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .side-nav {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }

    .side-nav.open {
        transform: translateX(0);
    }

    .chat-header {
        padding: 0.75rem 1rem;
    }

    .chat-messages {
        padding: 1.5rem 1rem;
    }

    .chat-input-container {
        padding: 1rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }
}

/* Smooth transitions for interactive elements */
.nav-btn,
.chat-item,
.account-info,
.model-btn,
.header-btn,
.attach-btn,
.mic-btn,
.send-btn {
    will-change: transform;
}

/* Focus states for accessibility */
.nav-btn:focus-visible,
.chat-item:focus-visible,
.model-btn:focus-visible,
.header-btn:focus-visible,
.send-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* typing dots */
.typing-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-secondary);
  display: inline-block;
  animation: dot 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2){ animation-delay: .15s; }
.typing-dots span:nth-child(3){ animation-delay: .3s; }

@keyframes dot {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Notification System */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 400px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.notification::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #FFD700, #FFA500);
}

.notification-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.notification-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.notification-link {
  color: #FFD700;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.notification-link:hover {
  color: #FFA500;
  text-decoration: underline;
}

.notification-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0.7;
}

.notification-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  opacity: 1;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.hiding {
  animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Buy Me a Coffee Button */
.coffee-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border: none;
  border-radius: 10px;
  color: #212121;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  margin-top: 0.5rem;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

.coffee-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  background: linear-gradient(135deg, #FFE44D, #FFB84D);
}

.coffee-button:active {
  transform: translateY(0);
}

.coffee-button svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Please Read Button */
.please-read-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.please-read-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.please-read-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Please Read Modal */
.please-read-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s;
  backdrop-filter: blur(4px);
}

.please-read-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.please-read-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.please-read-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.please-read-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.please-read-message {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.please-read-message p {
  margin-bottom: 0.5rem;
}

.please-read-message p:last-child {
  margin-bottom: 0;
}

/* Rainbow Link */
.rainbow-link {
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  text-decoration: none;
  animation: rainbow-shift 3s ease infinite;
  display: inline-block;
  position: relative;
}

.rainbow-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent-primary);
}

@keyframes rainbow-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Golden Glow Effect */
.golden-glow {
  color: #FFD700;
  text-shadow: 
    0 0 10px #FFD700,
    0 0 20px #FFD700,
    0 0 30px #FFA500,
    0 0 40px #FFA500;
  font-weight: 600;
  animation: golden-pulse 2s ease-in-out infinite;
}

@keyframes golden-pulse {
  0%, 100% {
    text-shadow: 
      0 0 10px #FFD700,
      0 0 20px #FFD700,
      0 0 30px #FFA500,
      0 0 40px #FFA500;
  }
  50% {
    text-shadow: 
      0 0 15px #FFD700,
      0 0 25px #FFD700,
      0 0 35px #FFA500,
      0 0 45px #FFA500,
      0 0 55px #FF8C00;
  }
}

/* RGB/Rainbow Text Effect */
.rgb-text {
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  animation: rgb-shift 2s ease infinite;
}

@keyframes rgb-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Easter Eggs Section in Modal */
.easter-eggs-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.easter-eggs-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.easter-eggs-content {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.875rem;
}

.golden-glow-demo {
  color: #FFD700;
  text-shadow: 
    0 0 10px #FFD700,
    0 0 20px #FFD700;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 4px;
}

.rgb-text-demo {
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  animation: rgb-shift 2s ease infinite;
  padding: 2px 6px;
}

/* Cyan to Red Gradient */
.cyan-red-gradient {
  background: linear-gradient(90deg, #00ffff, #ff0000);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  animation: cyan-red-shift 3s ease infinite;
}

@keyframes cyan-red-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.cyan-red-gradient-demo {
  background: linear-gradient(90deg, #00ffff, #ff0000);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  animation: cyan-red-shift 3s ease infinite;
  padding: 2px 6px;
}

/* Glowing Text */
.glowing-text {
  color: #10a37f;
  text-shadow: 
    0 0 10px #10a37f,
    0 0 20px #10a37f,
    0 0 30px #10a37f,
    0 0 40px #0d8f6e;
  font-weight: 600;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    text-shadow: 
      0 0 10px #10a37f,
      0 0 20px #10a37f,
      0 0 30px #10a37f,
      0 0 40px #0d8f6e;
  }
  50% {
    text-shadow: 
      0 0 15px #10a37f,
      0 0 25px #10a37f,
      0 0 35px #10a37f,
      0 0 45px #0d8f6e,
      0 0 55px #0d8f6e;
  }
}

.glowing-text-demo {
  color: #10a37f;
  text-shadow: 
    0 0 10px #10a37f,
    0 0 20px #10a37f;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(16, 163, 127, 0.1);
  border-radius: 4px;
}

/* Golden Text */
.golden-text {
  color: #FFD700;
  font-weight: 600;
}

.golden-text-demo {
  color: #FFD700;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 4px;
}

/* Upside Down Text */
.upside-down {
  display: inline-block;
  transform: rotate(180deg);
  transform-origin: center;
}

.upside-down-demo {
  display: inline-block;
  transform: rotate(180deg);
  transform-origin: center;
  padding: 2px 6px;
}

/* Christmas Effect */
.christmas-effect {
  background: linear-gradient(90deg, #00ffff, #00bfff, #00ffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  text-shadow: 
    0 0 10px rgba(0, 255, 255, 0.5),
    0 0 20px rgba(0, 255, 255, 0.3);
  animation: christmas-shift 2s ease infinite;
  position: relative;
}

.christmas-effect::before {
  content: '❄';
  position: absolute;
  left: -20px;
  animation: snowflake-fall 3s linear infinite;
  opacity: 0.7;
}

.christmas-effect::after {
  content: '❄';
  position: absolute;
  right: -20px;
  animation: snowflake-fall 3s linear infinite 1.5s;
  opacity: 0.7;
}

@keyframes christmas-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes snowflake-fall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 0.7;
  }
  100% {
    transform: translateY(20px) rotate(360deg);
    opacity: 0;
  }
}

.christmas-effect-demo {
  background: linear-gradient(90deg, #00ffff, #00bfff, #00ffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  text-shadow: 
    0 0 10px rgba(0, 255, 255, 0.5),
    0 0 20px rgba(0, 255, 255, 0.3);
  animation: christmas-shift 2s ease infinite;
  padding: 2px 6px;
}

/* Fireworks Effect */
.fireworks-effect {
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #ff00ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  animation: fireworks-explode 1.5s ease infinite;
  position: relative;
  text-shadow: 
    0 0 10px rgba(255, 0, 0, 0.5),
    0 0 20px rgba(255, 127, 0, 0.5),
    0 0 30px rgba(255, 255, 0, 0.5);
}

.fireworks-effect::before {
  content: '✨';
  position: absolute;
  left: -15px;
  top: -5px;
  animation: sparkle 1s ease infinite;
}

.fireworks-effect::after {
  content: '✨';
  position: absolute;
  right: -15px;
  top: -5px;
  animation: sparkle 1s ease infinite 0.5s;
}

@keyframes fireworks-explode {
  0%, 100% {
    background-position: 0% 50%;
    transform: scale(1);
  }
  25% {
    background-position: 50% 50%;
    transform: scale(1.1);
  }
  50% {
    background-position: 100% 50%;
    transform: scale(1.2);
  }
  75% {
    background-position: 50% 50%;
    transform: scale(1.1);
  }
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.5) rotate(180deg);
  }
}

.fireworks-effect-demo {
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #ff00ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  animation: fireworks-explode 1.5s ease infinite;
  padding: 2px 6px;
}

/* Delete buttons */
.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-item:hover .delete-btn,
.message-row:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.1);
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
}

.message-row.user-row {
  justify-content: flex-end;
}

.message-row.ai-row {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 780px;
  padding: 12px 16px;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.6;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9375rem;
  position: relative;
}

.message-row.ai-row .message-bubble {
  background: var(--bg-secondary);
}

.message-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
}

.message-bubble:hover .message-delete-btn {
  opacity: 1;
}

.message-delete-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Search Input */
.search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 0.5rem;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.25rem;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 160px;
  animation: contextMenuSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes contextMenuSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.context-menu-item:hover {
  background: var(--bg-hover);
}

.context-menu-item.danger {
  color: #ef4444;
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.context-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Custom Confirm Dialog */
.confirm-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
  backdrop-filter: blur(4px);
}

.confirm-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: dialogSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dialogSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-dialog-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.confirm-dialog-message {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.confirm-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.confirm-dialog-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.confirm-dialog-btn.primary {
  background: var(--accent-primary);
  color: white;
}

.confirm-dialog-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.confirm-dialog-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.confirm-dialog-btn.secondary:hover {
  background: var(--bg-hover);
}

/* Settings Page */
.settings-content {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
  overflow-y: auto;
  height: calc(100vh - 60px);
}

.settings-section {
  margin-bottom: 2.5rem;
}

.settings-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.settings-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-item:first-child {
  padding-top: 0;
}

.settings-item-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.settings-item-label span:first-child {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.settings-item-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.account-settings-full {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

.about-info {
  padding: 1rem 0;
}

.about-info p {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.about-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem !important;
}

.about-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.about-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.about-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Compact mode */
.compact-mode .message-row {
  margin-bottom: 8px;
}

.compact-mode .message-bubble {
  padding: 8px 12px;
}

/* Timestamps */
.message-timestamp {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Error Page */
.error-page {
  text-align: center;
  padding: 3rem;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.error-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.error-message {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.error-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent-primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.error-home-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .theme-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.theme-btn:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-btn.active {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.theme-preview {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.dark-preview {
  background: linear-gradient(135deg, #212121 0%, #171717 50%, #2a2a2a 100%);
}

.night-preview {
  background: linear-gradient(135deg, #1a1625 0%, #0f0b1a 50%, #241f2e 100%);
}

.high-contrast-preview {
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a1a1a 100%);
}

.light-preview {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 50%, #e8e8e8 100%);
}

.theme-warning {
  font-size: 0.75rem;
  color: #ff6b6b;
  font-weight: 600;
}


.logout-btn {
  padding: 0.625rem 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Markdown Styles */
.message-bubble strong {
  font-weight: 600;
  color: var(--text-primary);
}

.message-bubble em {
  font-style: italic;
  opacity: 0.9;
}

/* Improved Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-row {
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-item {
  animation: slideUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}