/* Ideas UI Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-tabs a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.nav-tabs a:hover {
    background: rgba(255,255,255,0.2);
}

.nav-tabs a.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: 20px;
    min-height: 600px;
}

/* History Sidebar */
.history-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    padding: 15px;
    height: fit-content;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.sidebar-header h3 {
    font-size: 16px;
    color: #667eea;
}

.view-all-link {
    color: #667eea;
    text-decoration: none;
    font-size: 12px;
}

.view-all-link:hover {
    text-decoration: underline;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: block;
    padding: 10px;
    border-radius: 4px;
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-item.active {
    background: #667eea;
    color: white;
}

.history-time {
    font-size: 14px;
    font-weight: bold;
}

.history-date {
    font-size: 12px;
    color: #6c757d;
}

.history-item.active .history-date {
    color: rgba(255,255,255,0.8);
}

.history-info {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 11px;
}

.history-status {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.history-status.complete {
    background: #28a745;
    color: white;
}

.history-status.error {
    background: #dc3545;
    color: white;
}

/* Page Content */
.page-content {
    flex: 1;
    min-width: 0;
}

/* View Headers */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-header h2 {
    color: #667eea;
}

.actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

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

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

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Dashboard */
.dashboard {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.status-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.status-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.status-info p {
    margin: 5px 0;
}

.no-data {
    color: #6c757d;
    font-style: italic;
}

.auth-status.authenticated {
    color: #28a745;
}

.auth-status.not-authenticated {
    color: #dc3545;
}

.refresh-section {
    margin: 20px 0;
}

.help-text {
    color: #6c757d;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-help {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
}

.actions-section {
    margin-top: 20px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Progress Bar */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

.progress-message {
    text-align: center;
    margin-top: 10px;
    color: #667eea;
    font-weight: bold;
}

/* Markdown View */
.markdown-view {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.markdown-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

.markdown-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.markdown-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Parsed View */
.parsed-view {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.section {
    margin-bottom: 30px;
}

.section h3 {
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.framework-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.framework-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.framework-number {
    font-weight: bold;
    color: #667eea;
}

.framework-name {
    flex: 1;
}

.idea-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.idea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.idea-header h4 {
    margin: 0;
    color: #667eea;
}

.idea-author {
    color: #6c757d;
    font-size: 12px;
}

.idea-brief,
.idea-content {
    margin-top: 10px;
}

.idea-content ul {
    margin-left: 20px;
}

.idea-content li {
    margin: 5px 0;
}

/* Ratings View */
.ratings-view {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.results-count {
    color: #6c757d;
    font-size: 14px;
}

.filters-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.filters-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 12px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

.ratings-table-container {
    overflow-x: auto;
}

.ratings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ratings-table th,
.ratings-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.ratings-table th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

.ratings-table tbody tr:hover {
    background: #f8f9fa;
}

.idea-title {
    max-width: 200px;
    word-wrap: break-word;
}

.avg-rate {
    font-weight: bold;
    text-align: center;
}

.avg-rate.high {
    color: #28a745;
    background: #d4edda;
}

.avg-rate.medium {
    color: #ffc107;
    background: #fff3cd;
}

.avg-rate.low {
    color: #dc3545;
    background: #f8d7da;
}

.rating-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rate-value {
    font-weight: bold;
    font-size: 16px;
}

.rate-desc {
    font-size: 10px;
    color: #6c757d;
    max-width: 150px;
}

/* Debug View */
.debug-view {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.logs-container {
    margin-top: 20px;
}

.log-stats {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 14px;
}

.log-entry {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.log-entry.log-debug {
    border-left-color: #6c757d;
}

.log-entry.log-info {
    border-left-color: #17a2b8;
}

.log-entry.log-warning {
    border-left-color: #ffc107;
}

.log-entry.log-error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.log-header {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 11px;
}

.log-timestamp {
    color: #6c757d;
}

.log-name {
    color: #667eea;
}

.log-level {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.level-debug {
    background: #6c757d;
    color: white;
}

.level-info {
    background: #17a2b8;
    color: white;
}

.level-warning {
    background: #ffc107;
    color: #333;
}

.level-error {
    background: #dc3545;
    color: white;
}

.log-message {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    word-wrap: break-word;
}

.no-logs,
.no-history {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Settings View */
.settings-view {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.settings-form {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.settings-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-text {
    color: #6c757d;
    font-size: 13px;
}

.info-text code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* History View */
.history-view {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.history-stats {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 14px;
}

.history-list-full {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-card {
    background: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}

.history-card.current {
    border: 2px solid #667eea;
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #e9ecef;
}

.history-datetime {
    display: flex;
    gap: 10px;
}

.history-datetime .date {
    font-weight: bold;
}

.history-datetime .time {
    color: #6c757d;
}

.history-actions {
    display: flex;
    gap: 5px;
}

.current-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.history-card-body {
    padding: 15px;
}

.history-detail {
    margin: 5px 0;
}

.history-detail strong {
    color: #667eea;
}

.status-complete {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

.history-links {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.restore-link {
    padding: 10px 15px;
    text-align: center;
    background: #e9ecef;
}

/* Responsive */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    
    .history-sidebar {
        width: 100%;
    }
}
