/* Second Brain Public Styles */

.sb-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sb-search-container {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    margin-right: 20px;
}

.sb-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.sb-search-input:focus {
    border-color: #667eea;
}

.sb-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sb-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.sb-btn-success {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.sb-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    color: white;
}

.sb-btn-info {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.sb-btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
    color: white;
}

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

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

.sb-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.sb-main-content {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 20px;
    min-height: 600px;
}

.sb-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sb-quick-capture {
    margin-bottom: 30px;
}

.sb-quick-capture h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
}

.sb-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.sb-textarea:focus {
    border-color: #667eea;
}

.sb-main-area {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.sb-nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.sb-node-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.sb-node-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

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

.sb-node-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    flex: 1;
}

.sb-node-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sb-node-card:hover .sb-node-actions {
    opacity: 1;
}

.sb-btn-icon {
    padding: 6px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
}

.sb-btn-icon:hover {
    background: #f8f9fa;
    color: #495057;
}

.sb-node-content p {
    margin: 0;
    color: #5a6c7d;
    line-height: 1.6;
    font-size: 14px;
}

.sb-node-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f1f3f4;
}

.sb-tag {
    display: inline-block;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sb-tag:hover {
    background: #bbdefb;
}

.sb-node-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: #9ca3af;
}

/* Chat Panel */
.sb-chat-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
    position: sticky;
    top: 20px;
}

.sb-chat-header {
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sb-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.sb-chat-message {
    margin-bottom: 15px;
    max-width: 80%;
}

.sb-chat-user {
    margin-left: auto;
    text-align: right;
}

.sb-chat-user .sb-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    display: inline-block;
}

.sb-chat-assistant .sb-message-content {
    background: #f8f9fa;
    color: #343a40;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #e9ecef;
}

.sb-chat-error .sb-message-content {
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #fcc;
}

.sb-chat-input-container {
    padding: 20px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
}

.sb-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

.sb-chat-input:focus {
    border-color: #667eea;
}

.sb-btn-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
}

.sb-btn-close:hover {
    color: #495057;
}

/* Modales */
.sb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sb-modal-large .sb-modal-content {
    max-width: 1200px;
    height: 80vh;
}

.sb-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sb-modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.sb-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    line-height: 1;
}

.sb-modal-close:hover {
    color: #495057;
}

.sb-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.sb-modal-footer {
    padding: 20px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sb-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    outline: none;
    box-sizing: border-box;
}

.sb-input:focus {
    border-color: #667eea;
}

.sb-editor {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.sb-editor:focus {
    border-color: #667eea;
}

/* Estados de carga */
.sb-loading-nodes, .sb-loading-tags, .sb-loading-recent {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.sb-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: sb-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes sb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estados vacíos */
.sb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 16px;
}

.sb-empty-state::before {
    content: '🧠';
    display: block;
    font-size: 48px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sb-main-content {
        grid-template-columns: 250px 1fr;
    }

    .sb-chat-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .sb-container {
        padding: 10px;
    }

    .sb-main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sb-sidebar {
        position: static;
        order: 2;
    }

    .sb-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .sb-search-container {
        max-width: 100%;
        margin-right: 0;
    }

    .sb-nodes-grid {
        grid-template-columns: 1fr;
    }

    .sb-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .sb-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Notificaciones */
.sb-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: sb-notification-appear 0.3s ease-out;
}

@keyframes sb-notification-appear {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.sb-notification-success {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.sb-notification-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.sb-notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 15px;
}
