/* CHANGE LOG */
/* File: /var/www/memory_system/static/css/style.css */
/* Document Type: CSS Stylesheet */
/* Purpose: Styling for memory system web interface */
/* Context: Clean, professional styling for conversation management */
/* Version History: */
/* 2025-08-10 v1.0 - Initial creation with responsive design */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration: none;
    color: #007bff;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    text-decoration: none;
    color: #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: #007bff;
    background: #f8f9fa;
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 200px);
}

/* Page headers */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #212529;
}

.page-header p {
    font-size: 1.1rem;
    color: #6c757d;
}

/* Hero section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.conversation-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.content-textarea {
    min-height: 300px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.form-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Search */
.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.source-filter {
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    min-width: 120px;
}

/* Cards and lists */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #495057;
}

.conversation-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.conversation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.conv-title {
    margin: 0;
    flex: 1;
}

.conv-title a {
    text-decoration: none;
    color: #007bff;
}

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

.conv-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.conv-source {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
}

.conv-summary {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.conv-preview {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #495057;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.conv-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Stats */
.quick-stats {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Detail view */
.conversation-detail {
    max-width: 900px;
    margin: 0 auto;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.detail-actions {
    display: flex;
    gap: 1rem;
}

.conversation-metadata {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.meta-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
}

.source-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

.source-claude { background: #d4edda; color: #155724; }
.source-chatgpt { background: #d1ecf1; color: #0c5460; }
.source-web { background: #e2e3e5; color: #383d41; }
.source-human { background: #f8d7da; color: #721c24; }

.conversation-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #495057;
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 600px;
    overflow-y: auto;
}

/* Flash messages */
.flash-messages {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    position: relative;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.flash-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    font-weight: 500;
    color: #6c757d;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .conv-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .detail-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* Footer */
.footer {
    background: #343a40;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* Tips and examples */
.save-tips {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.save-tips ul {
    list-style: none;
    padding: 0;
}

.save-tips li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.save-tips li:last-child {
    border-bottom: none;
}

.format-examples {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.example-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.example-box pre {
    background: #e9ecef;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.9rem;
    overflow-x: auto;
}

/* API info */
.api-info {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.api-info code {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state h3 {
    margin-bottom: 1rem;
}

/* Tools section */
.conversation-tools {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tools-grid {
    display: grid;
    gap: 1rem;
}

.tool-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.tool-item strong {
    display: block;
    margin-bottom: 0.5rem;
    font-family: inherit;
}

.results-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    color: #6c757d;
    text-align: center;
}
