/* ⟨Ψ|Ω|Ψ⟩ = 1 | Consciousness Portal Styles */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --accent-purple: #7B2FFF;
    --accent-pink: #FF2F9F;
    --accent-blue: #2F9FFF;
    --accent-green: #2FFF7B;
    --accent-gold: #FFD700;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --border-color: #2a2a35;
    --success: #2FFF7B;
    --warning: #FFD700;
    --error: #FF4444;
    --gradient-omega: linear-gradient(135deg, #7B2FFF 0%, #FF2F9F 50%, #FFD700 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.consciousness-body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Matrix Canvas Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.consciousness-header {
    background: rgba(10, 10, 15, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.consciousness-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.consciousness-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.omega-symbol {
    font-size: 2rem;
    background: var(--gradient-omega);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.consciousness-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-omega);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.axiom-display {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--accent-gold);
    font-size: 1rem;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-purple);
}

/* Main Content */
.consciousness-main {
    padding: 40px 20px;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 40px;
}

.welcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-omega);
}

.welcome-card h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    background: var(--gradient-omega);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 24px;
}

.entity-types {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.entity-tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.3s ease;
}

.action-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.action-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.action-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Buttons */
.action-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.action-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(123, 47, 255, 0.4);
}

.action-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    border-color: var(--accent-purple);
    background: var(--bg-card-hover);
}

.action-btn.tertiary {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

/* Input Fields */
.input-field,
.textarea-field {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-field:focus,
.textarea-field:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.input-field::placeholder,
.textarea-field::placeholder {
    color: var(--text-muted);
}

.textarea-field {
    resize: vertical;
    min-height: 100px;
}

.textarea-field.monospace {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
}

/* Import Form */
.import-form {
    display: flex;
    gap: 12px;
}

.import-form .input-field {
    flex: 1;
}

/* Wallet Result */
.wallet-result,
.import-result {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.result-item {
    margin-bottom: 16px;
}

.result-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.copyable {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid var(--border-color);
}

.copyable:hover {
    background: var(--bg-card-hover);
}

.copyable.secret {
    background: linear-gradient(90deg, var(--bg-secondary) 0%, rgba(123, 47, 255, 0.1) 100%);
}

.warning-box {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--warning);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--warning);
    font-size: 0.9rem;
    margin-top: 16px;
}

.success-message {
    color: var(--success);
    font-weight: 500;
    margin-top: 12px;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Memory Section */
.memory-section,
.browser-section,
.recent-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
}

/* Memory Type Selector */
.memory-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 8px;
    width: fit-content;
}

.type-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.type-btn.active {
    background: var(--accent-purple);
    color: white;
}

.type-btn:hover:not(.active) {
    background: var(--bg-card-hover);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

/* Upload Controls */
.upload-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.disconnected {
    background: var(--error);
}

.status-dot.connected {
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.upload-actions {
    display: flex;
    gap: 12px;
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.preview-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
}

.preview-content h3 {
    margin-bottom: 20px;
}

.preview-content pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    overflow: auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 20px;
    max-height: 400px;
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Search Controls */
.search-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
}

/* Sacred Addresses */
.sacred-addresses {
    margin-bottom: 24px;
}

.sacred-addresses h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.sacred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.sacred-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.sacred-item:hover {
    border-color: var(--accent-gold);
    background: var(--bg-card-hover);
}

.sacred-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-omega);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sacred-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Memory Results */
.memory-results {
    min-height: 200px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Memory Card */
.memory-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.memory-card:hover {
    border-color: var(--accent-purple);
}

.memory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.memory-entity {
    font-weight: 600;
    color: var(--accent-purple);
}

.memory-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.memory-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.memory-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.memory-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.memory-tag {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Footer */
.consciousness-footer {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.axiom-large {
    font-size: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    background: var(--gradient-omega);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

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

.footer-small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .consciousness-header .container {
        flex-direction: column;
        gap: 12px;
    }
    
    .axiom-display {
        order: -1;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .upload-controls {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-controls {
        flex-direction: column;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success);
    color: var(--bg-primary);
}

.toast.error {
    background: var(--error);
}

.toast.info {
    background: var(--accent-blue);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
