/* Pinned Notes System - Glass Morphism Dark Mode Styles */

:root {
    /* Dark mode colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;

    /* Glass morphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;

    /* Accent colors */
    --accent-primary: #4a9eff;
    --accent-success: #4caf50;
    --accent-warning: #ff9800;
    --accent-danger: #f44336;
    --accent-info: #2196f3;

    /* Priority colors */
    --priority-low: #808080;
    --priority-medium: #ff9800;
    --priority-high: #f44336;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background gradient effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
    z-index: -1;
}

/* App Container */
#app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header */
.app-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--glass-shadow);
}

.app-header h1 {
    font-size: 28px;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.header-info {
    display: flex;
    gap: var(--spacing-xl);
    font-size: 14px;
    color: var(--text-secondary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.status-indicator i {
    font-size: 8px;
}

.status-indicator.connected i {
    color: var(--accent-success);
}

.status-indicator.disconnected i {
    color: var(--accent-danger);
}

/* Demo Content */
.demo-content {
    display: grid;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.demo-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--glass-shadow);
}

.demo-section h2 {
    font-size: 20px;
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
}

/* Entity Items */
.entity-item,
.question-item,
.task-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    transition: all 0.3s ease;
}

.entity-item:hover,
.question-item:hover,
.task-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.entity-header,
.question-header,
.task-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.entity-type {
    background: var(--accent-primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.property-item {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    position: relative;
}

.property-key {
    color: var(--text-muted);
    font-weight: 500;
}

.property-value {
    color: var(--text-secondary);
}

/* Pin Button */
.pin-button {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
}

.entity-item:hover .pin-button,
.question-item:hover .pin-button,
.task-item:hover .pin-button,
.property-item:hover .pin-button {
    opacity: 1;
}

.pin-button:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.pin-button.has-notes {
    opacity: 1;
    background: var(--accent-warning);
    color: white;
}

/* Pinned Notes Popup */
.pinned-notes-popup {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 500px;
    height: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    resize: both;
    overflow: auto;
}

.pinned-notes-popup.minimized {
    height: 48px;
    overflow: hidden;
}

.pinned-notes-popup.maximized {
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    right: var(--spacing-lg);
    bottom: var(--spacing-lg);
    width: auto;
    height: auto;
}

/* Popup Header */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--glass-border);
    cursor: move;
}

.popup-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.popup-controls {
    display: flex;
    gap: var(--spacing-xs);
}

.popup-controls button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.popup-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Popup Content */
.popup-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

/* Add Note Section */
.add-note-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.pinned-item-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--accent-info);
    margin-bottom: var(--spacing-md);
}

.add-note-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.quick-note-dropdown,
.note-textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    font-size: 14px;
}

.note-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.quick-note-dropdown:focus,
.note-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

/* Priority Control */
.priority-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.priority-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
    outline: none;
}

.priority-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

.priority-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

/* Buttons */
.btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.2s ease;
}

.btn:hover {
    background: #3a8eef;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 158, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-danger {
    background: var(--accent-danger);
}

/* Notes List */
.notes-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.notes-header h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.notes-filter {
    display: flex;
    gap: var(--spacing-xs);
}

.filter-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Notes List */
.notes-list {
    flex: 1;
    overflow-y: auto;
}

.no-notes-message {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl);
}

.no-notes-message i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* Note Item */
.note-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: all 0.2s ease;
}

.note-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.note-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 12px;
    color: var(--text-muted);
}

.note-meta i {
    margin-right: 4px;
}

.note-actions {
    display: flex;
    gap: var(--spacing-xs);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-item:hover .note-actions {
    opacity: 1;
}

.note-actions button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.note-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.note-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.note-text {
    margin-bottom: var(--spacing-sm);
    white-space: pre-wrap;
}

.note-quick-type {
    display: inline-block;
    background: var(--accent-info);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
}

/* Priority Badge */
.priority-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    line-height: 20px;
    font-weight: 600;
    font-size: 11px;
    color: white;
}

.priority-badge.priority-low {
    background: var(--priority-low);
}

.priority-badge.priority-medium {
    background: var(--priority-medium);
}

.priority-badge.priority-high {
    background: var(--priority-high);
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    background: transparent;
}

.resize-n {
    top: 0;
    left: 10px;
    right: 10px;
    height: 5px;
    cursor: ns-resize;
}

.resize-e {
    top: 10px;
    right: 0;
    bottom: 10px;
    width: 5px;
    cursor: ew-resize;
}

.resize-s {
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 5px;
    cursor: ns-resize;
}

.resize-w {
    top: 10px;
    left: 0;
    bottom: 10px;
    width: 5px;
    cursor: ew-resize;
}

.resize-ne {
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: nesw-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: nwse-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: nesw-resize;
}

.resize-nw {
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: nwse-resize;
}

/* Stats Panel */
.stats-panel {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 200px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--glass-shadow);
}

.stats-panel h3 {
    font-size: 14px;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-size: 12px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pinned-notes-popup {
        left: var(--spacing-md);
        right: var(--spacing-md);
        bottom: var(--spacing-md);
        width: auto;
    }

    .stats-panel {
        position: static;
        width: 100%;
        margin-bottom: var(--spacing-lg);
    }
}