/**
 * MCPinator Custom Styles
 */

/* Global Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    overflow-y: auto;
}

/* Main app container - only hide overflow for the MCP client page */
.mcp-container {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.mcp-container .flex-grow-1 {
    flex: 1;
    min-height: 0; /* Important for nested flex containers */
}

/* Header Styles */
header {
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0 !important;
}

header h1 {
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* Terminal Container */
#terminal {
    padding: 10px;
    padding-bottom: 20px; /* Extra padding at bottom to prevent footer overlap */
    background-color: #1e1e1e;
}

.xterm {
    height: 100%;
}

.xterm-viewport {
    overflow-y: auto;
}

/* Info Panel Styles */
.card {
    border: none;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600;
    padding: 12px 16px;
}

.card-body {
    padding: 16px;
}

/* Tool Items */
.tool-item {
    transition: all 0.2s ease;
}

.tool-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.tool-item .fw-bold {
    font-size: 14px;
    margin-bottom: 4px;
}

.tool-item .small {
    font-size: 12px;
}

/* Resource Items */
.resource-item {
    transition: all 0.2s ease;
}

.resource-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.resource-item .fw-bold {
    font-size: 14px;
    margin-bottom: 4px;
}

.resource-item .small {
    font-size: 12px;
}

/* JSON Response */
#lastResponse {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    background-color: #f8f9fa !important;
    border-radius: 0 0 8px 8px;
}

#lastResponse code {
    display: block;
    white-space: pre;
}

/* Connection Status Badge */
#connectionStatus {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Button Styles */
.btn {
    font-weight: 500;
    border-radius: 6px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

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

/* Input Group */
.input-group-text {
    border-radius: 6px 0 0 6px;
    border: 1px solid #ced4da;
}

.input-group .form-control {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.input-group .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Server Info Styles */
#serverInfo, #capabilities {
    font-size: 13px;
    line-height: 1.6;
}

#serverInfo strong, #capabilities strong {
    color: #495057;
    font-weight: 600;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    #terminal {
        font-size: 12px;
    }

    .card-body {
        padding: 12px;
    }
}

/* Loading Animation */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Code Syntax Highlighting */
.text-primary { color: #0066cc !important; }
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-info { color: #17a2b8 !important; }
.text-secondary { color: #6c757d !important; }

/* Terminal Footer */
.bg-dark {
    background-color: #2d2d2d !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Utility Classes */
.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
}

.border-end {
    border-right: 1px solid #dee2e6 !important;
}

/* Animation for tool items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tool-item {
    animation: slideIn 0.3s ease;
}

.resource-item {
    animation: slideIn 0.3s ease;
}

/* Focus States */
input:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Compact UI Elements */
.card {
    margin-bottom: 0.75rem !important;
}

.card-header {
    padding: 0.5rem 0.75rem !important;
}

.card-body {
    padding: 0.75rem !important;
}

.btn {
    padding: 0.375rem 0.75rem !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem !important;
}

.input-group-text {
    padding: 0.375rem 0.75rem !important;
}

.form-control {
    padding: 0.375rem 0.75rem !important;
}

/* Card Header Icons */
.card-header i {
    margin-right: 6px;
}

/* Status Icons */
.bi-circle-fill {
    font-size: 8px;
    margin-right: 6px;
}

/* Empty State */
.text-muted i {
    margin-right: 6px;
}

/* Footer */
footer {
    flex-shrink: 0;
    z-index: 10;
}

/* Professional Polish */
.card-header.bg-info {
    background-color: #17a2b8 !important;
}

.card-header.bg-success {
    background-color: #28a745 !important;
}

.card-header.bg-warning {
    background-color: #ffc107 !important;
}

.card-header.bg-secondary {
    background-color: #6c757d !important;
}

/* Hover Effects */
.card {
    cursor: default;
}

.tool-item {
    cursor: pointer;
}

.resource-item {
    cursor: pointer;
}

/* Connection Status Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

#connectionStatus.bg-success .bi-circle-fill {
    animation: pulse 2s ease-in-out infinite;
}
