/* YaCy Seeds Server - Main Stylesheet */

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

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0; 
    padding: 20px; 
    background: #f5f5f5; 
    color: #333;
}

/* Layout */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* Typography */
h1 { 
    color: #2c3e50; 
    margin-bottom: 10px; 
}

h2 { 
    color: #34495e; 
    margin-top: 30px; 
    border-bottom: 2px solid #3498db; 
    padding-bottom: 10px; 
}

a { 
    color: #3498db; 
    text-decoration: none; 
}

a:hover { 
    text-decoration: underline; 
}

pre { 
    background: #2c3e50; 
    color: #ecf0f1; 
    padding: 15px; 
    border-radius: 5px; 
    overflow-x: auto; 
}

/* Info Box */
.info { 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    margin-bottom: 20px; 
}

/* Status */
.status { 
    color: #27ae60; 
    font-weight: bold; 
    font-size: 1.1em; 
}

.status-badge { 
    display: inline-block; 
    background: #27ae60; 
    color: white; 
    padding: 5px 15px; 
    border-radius: 20px; 
}

.status-online { color: #27ae60; }
.status-offline { color: #e74c3c; }
.status-checking { color: #f39c12; }

.status-dot { 
    display: inline-block; 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    margin-right: 5px; 
}

.status-dot.online { background: #27ae60; }
.status-dot.offline { background: #e74c3c; }
.status-dot.unknown { background: #95a5a6; }

.status-details { 
    font-size: 11px; 
    color: #7f8c8d; 
}

.status-summary { 
    background: #fff; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 15px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.status-summary .stat { 
    display: inline-block; 
    margin-right: 20px; 
}

.status-banner { 
    padding: 10px 15px; 
    border-radius: 5px; 
    margin-bottom: 15px; 
}

.status-banner.online { background: #d4edda; color: #155724; }
.status-banner.offline { background: #f8d7da; color: #721c24; }
.status-banner.unknown { background: #e9ecef; color: #6c757d; }

/* Tables */
table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

th, td { 
    padding: 12px 15px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
}

th { 
    background: #3498db; 
    color: white; 
    font-weight: 600; 
}

tr:hover { background: #f8f9fa; }

tr.selected { background: #d5e8f7 !important; }

tr.selectable { cursor: pointer; }
tr.selectable:hover { background: #e8f4fc; }

.seed-row { cursor: pointer; }
.seed-row:hover { background: #e8f4fc; }

/* Buttons */
.btn { 
    padding: 8px 16px; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 14px; 
    transition: all 0.2s; 
}

.btn-sm { 
    padding: 5px 10px; 
    font-size: 12px; 
}

.btn-primary { background: #3498db; color: white; }
.btn-primary:hover { background: #2980b9; }

.btn-success { background: #27ae60; color: white; }
.btn-success:hover { background: #229954; }

.btn-delete { background: #e74c3c; color: white; }
.btn-delete:hover { background: #c0392b; }

.btn-edit { background: #f39c12; color: white; }
.btn-edit:hover { background: #d68910; }

.btn-fetch { background: #9b59b6; color: white; }
.btn-fetch:hover { background: #8e44ad; }

.btn-status { background: #1abc9c; color: white; }
.btn-status:hover { background: #16a085; }

.btn .icon { margin-right: 4px; }
.btn-sm .icon { width: 12px; height: 12px; margin-right: 2px; }

/* Badges */
.badge { 
    padding: 3px 8px; 
    border-radius: 12px; 
    font-size: 11px; 
    text-transform: uppercase; 
}

.badge-senior { background: #3498db; color: white; }
.badge-principal { background: #e74c3c; color: white; }
.badge-junior { background: #95a5a6; color: white; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    font-size: 14px; 
}

.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

/* Modals */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 1000; 
}

.modal-content { 
    background: #fff; 
    max-width: 600px; 
    margin: 50px auto; 
    padding: 25px; 
    border-radius: 10px; 
}

.modal-content.wide { max-width: 700px; }

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

.modal-header h3 { margin: 0; }

.close { 
    font-size: 28px; 
    cursor: pointer; 
    color: #999; 
}

.close:hover { color: #333; }

/* Endpoints Grid */
.endpoints { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 15px; 
}

.endpoint { 
    background: #ecf0f1; 
    padding: 15px; 
    border-radius: 8px; 
}

.endpoint h4 { margin: 0 0 5px 0; color: #2c3e50; }
.endpoint p { margin: 0; color: #7f8c8d; font-size: 14px; }

/* Toast Notifications */
.toast { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    padding: 15px 25px; 
    border-radius: 8px; 
    color: white; 
    display: none; 
    z-index: 2000; 
}

.toast-success { background: #27ae60; }
.toast-error { background: #e74c3c; }

/* Actions Bar */
.actions-bar { 
    display: flex; 
    gap: 10px; 
    margin: 20px 0; 
    flex-wrap: wrap; 
    align-items: center; 
}

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

/* No Selection Message */
.no-selection { 
    text-align: center; 
    padding: 40px; 
    color: #7f8c8d; 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

/* Spinner */
.spinner { 
    display: inline-block; 
    width: 12px; 
    height: 12px; 
    border: 2px solid #ddd; 
    border-top-color: #3498db; 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* Detail Grid */
.detail-grid { 
    display: grid; 
    grid-template-columns: 140px 1fr; 
    gap: 10px; 
    margin-bottom: 15px; 
}

.detail-grid .label { font-weight: 600; color: #555; }

.detail-grid .value { 
    word-break: break-all; 
    font-family: monospace; 
    background: #f8f9fa; 
    padding: 5px 10px; 
    border-radius: 4px; 
}

.detail-section { margin-bottom: 20px; }

.detail-section h4 { 
    margin: 0 0 10px 0; 
    color: #34495e; 
    border-bottom: 1px solid #ddd; 
    padding-bottom: 5px; 
}

/* Icons */
.icon { 
    width: 16px; 
    height: 16px; 
    display: inline-block; 
    vertical-align: middle; 
}

.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

h1 .icon, h2 .icon { width: 24px; height: 24px; margin-right: 8px; }
.detail-section h4 .icon { width: 18px; height: 18px; margin-right: 6px; }

/* Search and Filter Bar */
.search-filter-bar { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 15px; 
    flex-wrap: wrap; 
    align-items: center; 
    background: #fff; 
    padding: 15px; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.search-filter-bar input[type="text"] { 
    padding: 8px 12px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    font-size: 14px; 
    min-width: 200px; 
}

.search-filter-bar select { 
    padding: 8px 12px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    font-size: 14px; 
}

/* Type Toggles */
.type-toggles { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
}

.type-toggle { 
    padding: 5px 12px; 
    border-radius: 15px; 
    cursor: pointer; 
    font-size: 12px; 
    text-transform: uppercase; 
    transition: all 0.2s; 
    border: 2px solid transparent; 
}

.type-toggle.active { opacity: 1; }
.type-toggle.inactive { opacity: 0.4; }

.type-toggle.senior { background: #3498db; color: white; }
.type-toggle.senior.inactive { background: #bdc3c7; }

.type-toggle.principal { background: #e74c3c; color: white; }
.type-toggle.principal.inactive { background: #bdc3c7; }

.type-toggle.junior { background: #95a5a6; color: white; }
.type-toggle.junior.inactive { background: #bdc3c7; }

/* Pagination */
.pagination { 
    display: flex; 
    gap: 5px; 
    align-items: center; 
    justify-content: center; 
    margin-top: 15px; 
}

.pagination button { 
    padding: 6px 12px; 
    border: 1px solid #ddd; 
    background: #fff; 
    border-radius: 4px; 
    cursor: pointer; 
}

.pagination button:hover:not(:disabled) { 
    background: #e8f4fc; 
    border-color: #3498db; 
}

.pagination button:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
}

.pagination button.active { 
    background: #3498db; 
    color: white; 
    border-color: #3498db; 
}

.pagination .page-info { 
    color: #7f8c8d; 
    font-size: 13px; 
    margin: 0 10px; 
}

/* Filter Labels */
.filter-label { 
    font-size: 13px; 
    color: #7f8c8d; 
    margin-right: 5px; 
}

.results-info { 
    font-size: 13px; 
    color: #7f8c8d; 
}
