/* Global stylesheet for NZ AI Regulation Chat application */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Zilla+Slab+Mono:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&family=Courier+Prime:wght@400;700&family=Courier+Prime+Code:wght@400;700&display=swap');

:root {
    /* Colors from updated design system */
    --light: #fff;
    --lightgray: #e2e8f0;
    --gray: #94a3b8;
    --darkgray: #2f4858;
    --dark: #1a2421;
    --secondary: #2daf61;
    --secondary-light: #ffdd56;
    --orange: #ff8080;
    --orange-light: #f39c12;
    --orange-dark: #d35400;
    --green-accent: #de87ce;
    
    /* Theme colors */
    --primary: var(--secondary);
    --accent: var(--orange);
    
    /* Text and background colors */
    --text-primary: var(--dark);
    --text-secondary: var(--darkgray);
    --background-primary: var(--light);
    --background-secondary: #f0f0f0;
    --border-color: var(--gray);
    
    /* Updated fonts */
    --header-font: "Zilla Slab Mono", "Courier Prime", serif;
    --body-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --code-font: "Courier Prime Code", "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
    
    /* Spacing and sizing */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
    --transition: all 0.2s ease;
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--background-primary);
    font-family: var(--body-font);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--header-font);
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 0.5em 0;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1em 0;
    line-height: 1.6;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-light);
    text-decoration: underline;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid var(--lightgray);
    padding: 14px 20px;
    font-size: 16px;
    font-family: var(--body-font);
    background-color: var(--background-primary);
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 175, 97, 0.1);
}

.form-control::placeholder {
    color: var(--gray);
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    font-family: var(--body-font);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(45, 175, 97, 0.3);
}

.btn-outline-light {
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.5);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages and alerts */
.message {
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.message.success {
    background-color: rgba(46, 204, 113, 0.1);
    border-color: var(--green-accent);
    color: var(--secondary);
}

.message.error {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    color: #c0392b;
}

.message.info {
    background-color: rgba(52, 152, 219, 0.1);
    border-color: #3498db;
    color: #2980b9;
}

/* Info boxes */
.info-box {
    background: var(--background-secondary);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
    font-size: 0.9rem;
}

.info-box i {
    color: var(--primary);
    margin-right: 8px;
}

/* Cards and containers */
.card {
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.auth-container {
    background: var(--background-primary);
    border-radius: var(--border-radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Header styles */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-family: var(--header-font);
    font-weight: 400;
}

.auth-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Chat-specific styles */
.chat-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, #2ea968 100%);
    color: white;
    padding: 20px 24px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-bottom: 0;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 20px rgba(45, 175, 97, 0.1);
}

.chat-header h1 {
    font-family: var(--header-font);
    font-weight: 400;
    margin: 0;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    color: black;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
}

.chat-header p {
    margin: 8px 0 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
    font-weight: 400;
}

.chat-box {
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 0;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--border-color);
}

/* Message styles */
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
    margin: 1em 0 0.5em 0;
    font-family: var(--header-font);
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.message-content code {
    background: var(--background-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--code-font);
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.message-content pre {
    background: var(--background-secondary);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    margin: 1em 0;
    border: 1px solid var(--border-color);
}

.message-content pre code {
    background: none;
    padding: 0;
    border: none;
}

/* Loading spinner */
.spinner-border {
    width: 1.2rem;
    height: 1.2rem;
    border-color: var(--primary);
}

/* Disclaimer bar */
.disclaimer-bar {
    background: linear-gradient(90deg, rgba(222, 135, 206, 0.1) 0%, rgba(45, 175, 97, 0.1) 100%);
    border-bottom: 1px solid rgba(222, 135, 206, 0.2);
    padding: 8px 0;
    font-size: 0.85rem;
    text-align: center;
}

.disclaimer-content {
    color: var(--text-secondary);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.disclaimer-content i {
    color: var(--green-accent);
    margin-right: 6px;
}

.disclaimer-link {
    color: var(--primary);
    text-decoration: none;
    margin-left: 8px;
    font-weight: 500;
}

.disclaimer-link:hover {
    text-decoration: underline;
}

/* Standard page layout styles */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

.header {
    background-color: var(--primary);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.header h1 {
    font-family: var(--header-font);
    margin: 0;
    font-size: 1.8rem;
    font-weight: 400;
    color: black;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
}

.header p {
    margin: 8px 0 0 0;
    opacity: 0.9;
    color: white;
}

.content-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--lightgray);
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.content-container h2 {
    font-family: var(--header-font);
    color: var(--text-primary);
    margin-bottom: 16px;
    margin-top: 24px;
    font-weight: 400;
}

.content-container h2:first-child {
    margin-top: 0;
}

.content-container h3 {
    font-family: var(--header-font);
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 400;
}

.content-container p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.content-container ul {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.content-container li {
    margin-bottom: 8px;
}

.back-button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--body-font);
    font-weight: 400;
    transition: all 0.2s ease;
    margin-top: 24px;
}

.back-button:hover {
    background-color: var(--secondary-light);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Feature and info boxes */
.feature-highlight {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    border-left: 4px solid var(--primary);
}

.feature-highlight i {
    color: var(--primary);
    margin-right: 8px;
}

.safety-feature {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    border-left: 4px solid var(--green-accent);
}

.safety-feature i {
    color: var(--green-accent);
    margin-right: 8px;
}

.tech-stack {
    background: rgba(30, 136, 229, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    border-left: 4px solid #1e88e5;
}

.tech-stack i {
    color: #1e88e5;
    margin-right: 8px;
}

.warning-box {
    background: rgba(244, 197, 79, 0.1);
    border: 1px solid rgba(244, 197, 79, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    border-left: 4px solid #f4c54f;
}

.warning-box i {
    color: #f4c54f;
    margin-right: 8px;
}

.placeholder-note {
    background: var(--background-secondary);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    border-left: 4px solid var(--accent);
    font-style: italic;
}

.placeholder-note i {
    color: var(--accent);
    margin-right: 8px;
}

/* Accordion styles */
.accordion {
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid var(--lightgray);
}

.accordion-item {
    border: none;
}

.accordion-button {
    background-color: var(--background-secondary);
    color: var(--text-primary);
    border: none;
    padding: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--body-font);
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary);
    color: white;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
}

.accordion-body {
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .auth-container {
        padding: 32px 24px;
        margin: 16px;
        border-radius: var(--border-radius);
    }
    
    .auth-header {
        margin-bottom: 24px;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .form-control {
        padding: 14px 18px;
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 14px;
    }
    
    .chat-container {
        padding: 0;
        height: 100vh;
    }
    
    .chat-header {
        padding: 16px 20px;
        border-radius: 0;
    }
    
    .chat-header h1 {
        font-size: 1.3rem;
        color: black;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
    }
    
    .chat-box {
        border-radius: 0;
        margin-bottom: 0;
    }
    
    .disclaimer-bar {
        padding: 4px 0;
        font-size: 0.75rem;
    }
    
    .disclaimer-content {
        padding: 0 12px;
        word-wrap: break-word;
    }
    
    /* Standard page layout mobile styles */
    .container {
        margin: 20px auto;
        padding: 16px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
        color: black;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
    }
    
    .content-container {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .auth-header h2 {
        font-size: 1.25rem;
    }
    
    .form-control {
        padding: 12px 16px;
    }
    
    .chat-header h1 {
        font-size: 1.1rem;
        color: black;
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7);
    }
}

/* Search page styles */
.search-form {
    margin-bottom: 2rem;
}

.search-form .input-group {
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.search-form .form-control {
    border: 2px solid var(--lightgray);
    border-right: none;
    font-size: 16px;
    padding: 12px 16px;
}

.search-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: none;
}

.search-form .btn {
    border: 2px solid var(--primary);
    border-left: none;
    padding: 12px 20px;
    font-weight: 400;
}

.results-header {
    border-bottom: 2px solid var(--lightgray);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-item {
    background: var(--background-primary);
    border: 1px solid var(--lightgray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.result-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.result-title {
    margin: 0;
    font-weight: 400;
    flex: 1;
}

.result-title a {
    color: var(--primary);
    text-decoration: none;
}

.result-title a:hover {
    text-decoration: underline;
}

.result-meta {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.result-meta .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.result-content {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.search-footer {
    border-top: 1px solid var(--lightgray);
    padding-top: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .result-meta {
        align-self: flex-start;
    }
    
    .result-item {
        padding: 1rem;
    }
    
    .search-form .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .header-actions {
        justify-content: center;
        margin-top: 1rem;
    }
}