/**
 * Home page styles for multi-graph dashboard.
 */

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #2c3e50;
    color: white;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

#header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Graphs section */
#graphs-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

#graphs-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

/* Loading and empty states */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #666;
}

.loading-state .spinner {
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
}

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

#graphs-table thead {
    background: #f8f9fa;
}

#graphs-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

#graphs-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

#graphs-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#graphs-table tbody tr:hover {
    background: #f0f7ff;
}

.graph-name {
    font-weight: 500;
    color: #2c3e50;
}

.graph-neurons,
.graph-edges,
.graph-runs {
    color: #666;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.graph-updated {
    color: #888;
    font-size: 0.9rem;
}

.graph-actions {
    width: 50px;
    text-align: center;
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.15s ease;
    font-size: 1.2rem;
}

.delete-btn:hover {
    opacity: 1;
}

.delete-icon {
    color: #dc3545;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #333;
}

.modal-content > p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Form styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.form-group input[type="file"] {
    padding: 0.5rem 0;
}

/* Source tabs */
.source-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.source-content {
    margin-top: 1rem;
}

.source-content.hidden {
    display: none;
}

/* Hint text */
.hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

/* Error message */
.error-message {
    background: #fef0f0;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.error-message.hidden {
    display: none;
}

/* Progress message */
.progress-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #e8f4fd;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: #0c5460;
}

.progress-message.hidden {
    display: none;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Modal buttons */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-buttons button {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button styles */
.primary-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.primary-btn:hover:not(:disabled) {
    background: #2980b9;
}

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

.danger-btn:hover:not(:disabled) {
    background: #c82333;
}

.modal-buttons button:not(.primary-btn):not(.danger-btn) {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
}

.modal-buttons button:not(.primary-btn):not(.danger-btn):hover {
    background: #e9ecef;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: #888;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    #graphs-section {
        padding: 1rem;
    }

    #graphs-table th,
    #graphs-table td {
        padding: 0.75rem 0.5rem;
    }

    .graph-neurons,
    .graph-edges {
        display: none;
    }
}
