/* ==========================================================================
   AI Agent Marketplace -- Global Styles
   ========================================================================== */

/* ---- Reset & Base ---- */
a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 600; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    padding: 0.65rem 1.5rem; border-radius: 10px; border: none;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
    line-height: 1.4;
}
.btn-primary {
    background: var(--color-accent); color: #fff;
}
.btn-primary:hover {
    background: var(--color-accent-hover); color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}
.btn-outline {
    background: transparent; color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}
.btn-outline:hover {
    border-color: var(--color-accent); color: var(--color-accent);
    background: rgba(59, 130, 246, 0.06);
}
.btn-sm { font-size: 0.8rem; padding: 0.45rem 1rem; border-radius: 8px; }
.btn-lg { font-size: 1rem; padding: 0.85rem 2rem; border-radius: 12px; }

/* ---- Navigation ---- */
.nav-container {
    max-width: 1280px; margin: 0 auto; height: 72px;
    padding: 0 1.5rem; display: flex; align-items: center; gap: 1.5rem;
}
.nav-brand {
    display: flex; align-items: center; gap: 0.6rem;
    text-decoration: none; color: var(--color-text-primary);
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.nav-brand-icon { display: flex; }
.nav-brand-text { white-space: nowrap; }
.nav-links { display: flex; gap: 0.25rem; flex: 1; justify-content: center; }
.nav-link {
    font-size: 0.85rem; font-weight: 500; color: var(--color-text-secondary);
    padding: 0.5rem 0.75rem; border-radius: 8px; transition: all 0.2s;
    text-decoration: none;
}
.nav-link:hover { color: var(--color-text-primary); background: rgba(255,255,255,0.05); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.nav-hamburger {
    display: none; flex-direction: column; gap: 4px; padding: 8px;
    background: none; border: none; cursor: pointer;
}
.hamburger-line {
    width: 20px; height: 2px; background: var(--color-text-secondary);
    transition: all 0.3s; border-radius: 2px;
}
.nav-hamburger.active .hamburger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.active .hamburger-line:nth-child(2) { opacity: 0; }
.nav-hamburger.active .hamburger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.site-nav.scrolled { background: rgba(10, 15, 30, 0.95); }

/* ---- Mobile Nav Overlay ---- */
.mobile-nav-overlay {
    position: fixed; inset: 0; z-index: 1001;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.mobile-nav-overlay.active { opacity: 1; pointer-events: auto; }
.mobile-nav-panel {
    position: absolute; right: 0; top: 0; bottom: 0; width: 300px;
    background: var(--color-bg-secondary); padding: 1.5rem;
    transform: translateX(100%); transition: transform 0.3s;
    overflow-y: auto;
}
.mobile-nav-overlay.active .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem;
}
.mobile-nav-close {
    background: none; border: none; color: var(--color-text-secondary);
    cursor: pointer; padding: 4px;
}
.mobile-nav-links { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-nav-link {
    font-size: 1rem; font-weight: 500; color: var(--color-text-secondary);
    padding: 0.75rem 0.5rem; border-radius: 8px; text-decoration: none;
    transition: all 0.2s;
}
.mobile-nav-link:hover { color: var(--color-text-primary); background: rgba(255,255,255,0.05); }
.mobile-nav-link--cta {
    background: var(--color-accent); color: #fff; text-align: center;
    margin-top: 0.5rem; border-radius: 10px;
}
.mobile-nav-link--cta:hover { background: var(--color-accent-hover); color: #fff; }
.mobile-nav-divider { border: none; border-top: 1px solid var(--color-border); margin: 0.75rem 0; }

/* ---- Flash Messages ---- */
.flash-container {
    position: fixed; top: 80px; right: 1rem; z-index: 2000;
    display: flex; flex-direction: column; gap: 0.5rem; max-width: 420px;
}
.flash-message {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; border-radius: 10px;
    background: var(--color-bg-tertiary); border: 1px solid var(--color-border);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.flash-content { display: flex; align-items: center; gap: 0.6rem; }
.flash-icon { display: flex; flex-shrink: 0; }
.flash-text { font-size: 0.85rem; color: var(--color-text-primary); }
.flash-close {
    background: none; border: none; color: var(--color-text-muted);
    cursor: pointer; padding: 4px; margin-left: 0.5rem; flex-shrink: 0;
}
.flash-close:hover { color: var(--color-text-primary); }
.flash-success .flash-icon { color: var(--color-success); }
.flash-danger .flash-icon, .flash-error .flash-icon { color: var(--color-error); }
.flash-warning .flash-icon { color: var(--color-warning); }
.flash-info .flash-icon { color: var(--color-info); }

/* ---- Footer ---- */
.site-footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}
.footer-container { max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand { }
.footer-logo {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: var(--color-text-primary); text-decoration: none;
    font-weight: 700; font-size: 1rem; margin-bottom: 0.75rem;
}
.footer-tagline { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 1rem; max-width: 280px; }
.footer-social { display: flex; gap: 0.6rem; }
.social-link {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted); transition: all 0.2s;
}
.social-link:hover { color: var(--color-accent); border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.06); }
.footer-heading {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 1rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links li a, .footer-links li span {
    font-size: 0.85rem; color: var(--color-text-secondary); transition: color 0.2s;
}
.footer-links li a:hover { color: var(--color-text-primary); }
.footer-contact li { display: flex; align-items: center; gap: 0.5rem; }
.footer-contact li svg { flex-shrink: 0; color: var(--color-text-muted); }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 1.5rem; border-top: 1px solid var(--color-border);
    font-size: 0.78rem; color: var(--color-text-muted);
}
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: var(--color-text-muted); }
.footer-legal a:hover { color: var(--color-text-secondary); }

/* ---- Error Pages ---- */
.error-section { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 2rem 1.5rem; }
.error-container { text-align: center; max-width: 480px; }
.error-graphic { position: relative; margin-bottom: 1.5rem; }
.error-code { font-size: 6rem; font-weight: 800; color: rgba(59,130,246,0.15); line-height: 1; }
.error-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
}
.error-glow--red { background: radial-gradient(circle, rgba(239,68,68,0.15) 0%, transparent 70%); }
.error-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }
.error-message { font-size: 0.95rem; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 2rem; }
.error-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ---- Chat-specific shared styles ---- */
.msg { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; align-items: flex-start; }
.msg--user { flex-direction: row-reverse; }
.msg-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.msg-bubble {
    max-width: 70%; padding: 0.85rem 1.1rem; border-radius: 14px;
    font-size: 0.9rem; line-height: 1.65;
}
.msg--agent .msg-bubble { background: var(--color-bg-secondary); color: var(--color-text-primary); border: 1px solid var(--color-border); }
.msg--user .msg-bubble { background: var(--color-accent); color: #fff; }

/* Typing indicator */
.typing-indicator { display: none; align-items: center; gap: 0.75rem; padding: 0 1.5rem; margin-bottom: 0.75rem; }
.typing-dots { display: flex; gap: 4px; }
.typing-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--color-text-muted);
    animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Requirements sidebar */
.req-progress { height: 4px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem; }
.req-progress-bar { height: 100%; background: var(--color-accent); border-radius: 4px; transition: width 0.5s; }
.req-score { font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.req-list-title { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin: 0.75rem 0 0.35rem; }
.req-list { display: flex; flex-direction: column; gap: 0.3rem; }
.req-item { font-size: 0.8rem; color: var(--color-text-secondary); padding-left: 1rem; position: relative; }
.req-item::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 6px; height: 6px; border-radius: 50%; }
.req-item--done::before { background: var(--color-success); }
.req-item--pending::before { background: var(--color-text-muted); }
.req-empty { font-size: 0.82rem; color: var(--color-text-muted); }
.btn-complete-discovery {
    width: 100%; margin-top: 1rem; padding: 0.65rem 1rem; border: none; border-radius: 10px;
    background: var(--color-success); color: #fff; font-family: inherit;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-complete-discovery:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .nav-actions { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }
    .footer-legal { flex-wrap: wrap; justify-content: center; }
    .msg-bubble { max-width: 85%; }
}
