/* OBS Bridge System - Global Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #001f5f 0%, #00bdf6 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    margin: 0 auto;
}

/* Header */
.header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

h1 {
    color: #000000;
    margin-bottom: 10px;
    font-size: larger;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    color: black;
    display: flex;
    align-items: center;
    gap: 10px;
    background: whitesmoke;
}

.btn-primary:hover {
    background: #00bdf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: #48bb78;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-secondary {
    background: #718096;
    color: white;
}
.btn-text-only {
    color: rgb(0, 0, 0);
}
.btn-text-only:hover {
    color: rgb(0, 0, 0);
    background: #e2e8f0;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Connections Grid */
.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Connection Card */
.connection-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.connection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

/* Drag and Drop Styles */
.draggable-card {
    transition: all 0.3s ease;
}

.draggable-card.dragging {
    opacity: 0.5;
    transform: scale(0.98) rotate(1deg);
}

.draggable-card.drag-over-card {
    border: 2px solid #667eea;
    background: #f7faff;
    transform: scale(1.02);
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    cursor: grab;
    margin-right: 8px;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.drag-handle:hover {
    background: rgba(102, 126, 234, 0.1);
}

.drag-handle:active,
.drag-handle.handle-dragging {
    cursor: grabbing;
}

.drag-handle.drag-over {
    background: #667eea;
    transform: scale(1.2);
}

.drag-handle.drag-over img {
    filter: brightness(0) invert(1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #edf2f7;
}

.machine-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-connected {
    background: #c6f6d5;
    color: #22543d;
}

.status-disconnected {
    background: #fed7d7;
    color: #742a2a;
}

.status-error {
    background: #feebc8;
    color: #7c2d12;
}

/* Card Info */
.card-info {
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.info-label {
    color: #718096;
    font-weight: 500;
}

.info-value {
    color: #2d3748;
    font-weight: 400;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.modal-header h2 {
    color: #2d3748;
    margin-bottom: 5px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.empty-state h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.empty-state p {
    color: #718096;
    margin-bottom: 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 18px;
}

/* Messages */
.success-message,
.error-message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.success-message {
    background: #c6f6d5;
    color: #22543d;
}

.error-message {
    background: #fed7d7;
    color: #742a2a;
}

.success-message.show,
.error-message.show {
    display: block;
}

/* Login Page Specific */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 400px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #2d3748;
    margin-bottom: 10px;
}

.login-header p {
    color: #718096;
    font-size: 14px;
}

.default-creds {
    background: #feebc8;
    color: #7c2d12;
    padding: 12px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 13px;
    text-align: center;
}

/* Settings Page */
.settings-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.settings-card h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 20px;
}

.info-box {
    background: #bee3f8;
    color: #2c5282;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
}

.webhook-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.webhook-status.enabled {
    background: #c6f6d5;
    color: #22543d;
}

.webhook-status.disabled {
    background: #fed7d7;
    color: #742a2a;
}

/* Commands Page */
.back-link {
    display: inline-block;
    margin-top: 15px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.search-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.category {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header h2 {
    font-size: 20px;
    color: white;
}

.category-content {
    padding: 20px;
}

.command {
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.command:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.command-name {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.command-description {
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.6;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 10px;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
}

.badge-method {
    background: #667eea;
    color: white;
}

.badge-category {
    background: #edf2f7;
    color: #4a5568;
}

.parameters {
    margin-top: 15px;
}

.parameters h4 {
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 10px;
}

.param {
    background: #f7fafc;
    padding: 10px;
    border-left: 3px solid #667eea;
    margin-bottom: 8px;
    font-size: 13px;
}

.param-name {
    font-weight: 600;
    color: #2d3748;
}

.param-type {
    color: #667eea;
    font-style: italic;
}

.param-description {
    color: #4a5568;
    margin-top: 4px;
}

.try-it {
    margin-top: 15px;
}

.try-it-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.try-it-btn:hover {
    background: #38a169;
}

.response-output {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.response-output pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Operations Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.stat-item {
    background: #f7fafc;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    width: 160px
}

.stat-label {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    overflow-wrap: break-word;
}

.stat-value.good { 
    color: #38a169; 
}

.stat-value.warning { 
    color: #dd6b20; 
}

.stat-value.critical { 
    color: #e53e3e; 
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-toggle {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-streaming {
    background: #e53e3e;
    border-color: #c53030;
}

.btn-streaming:hover {
    background: #c53030;
}

.btn-recording {
    background: #dd6b20;
    border-color: #c05621;
}

.btn-recording:hover {
    background: #c05621;
}

/* Scene Selection Modal */
.scene-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.scene-item {
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.scene-item:hover {
    background: #f7fafc;
}

.scene-item.active {
    background: #edf2f7;
    border-left: 3px solid #009cc6;
}

.scene-name {
    font-weight: 500;
    color: #2d3748;
}

.scene-badge {
    padding: 4px 8px;
    background: #009cc6;
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #009cc6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.uploading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.uploading-overlay.active {
    display: flex;
}

.uploading-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    min-width: 300px;
}

.uploading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #009cc6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.uploading-text {
    color: #2d3748;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
}

.uploading-subtext {
    color: #718096;
    font-size: 14px;
}

/* Bulk Actions */
.bulk-actions-bar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: none;
}

.bulk-actions-bar.active {
    display: block;
}

.bulk-actions-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.bulk-selection-info {
    color: #2d3748;
    font-weight: 500;
}

.bulk-actions-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.connection-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.card-header-with-checkbox {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.card-header-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #edf2f7;
    user-select: none;
}

.btn-expand-collapse {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    border-radius: 4px;
}

.btn-expand-collapse:hover {
    background: #f7fafc;
}

.btn-expand-collapse .icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.card-content-collapsible {
    padding-top: 15px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.bulk-upload-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 6px;
    border: 2px dashed #cbd5e0;
}

.upload-area {
    text-align: center;
    padding: 20px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-label:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* Auto-refresh indicator */
.refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #718096;
    font-size: 13px;
    margin-top: 10px;
}

.refresh-indicator .dot {
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .connections-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        width: 100%;
    }
}
.icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.user-info {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-direction: row;
}
.user-account {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    margin-bottom: 10px;
}

/* Status indicators in card header */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-indicator img {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    transition: opacity 0.2s, filter 0.2s;
}

.status-indicator.active img {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
}