/**
 * Connections Page - Apple HIG-Inspired Connectivity Center
 * @version 2.0.0
 * @design macOS Monterey System Settings
 */

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL RESETS & BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
    min-height: 100vh;
    color: #1d1d1f;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 16px;
    color: #86868b;
    font-weight: 400;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard {
    background: rgba(255, 255, 255, 0.98);
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
                0 2px 8px rgba(0, 0, 0, 0.04);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.dashboard h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.devices-description {
    font-size: 14px;
    color: #86868b;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONNECTIONS GRID
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   CONNECTION CARDS (macOS System Settings Style)
   ═══════════════════════════════════════════════════════════════════════════ */

.connection-card {
    background: #ffffff;
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Colored Left Accent Bar */
.connection-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #86868b;
    transition: all 0.3s ease;
}

/* MongoDB - Green Accent */
.connection-card[data-type="mongodb"]::before,
.connection-card.type-mongodb::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.connection-card[data-type="mongodb"],
.connection-card.type-mongodb {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #a7f3d0;
}

/* PostgreSQL - Blue Accent */
.connection-card[data-type="postgresql"]::before,
.connection-card.type-postgresql::before {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.connection-card[data-type="postgresql"],
.connection-card.type-postgresql {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-color: #bfdbfe;
}

/* SharePoint/Cloud - Azure Blue */
.connection-card[data-type="sharedrive"]::before,
.connection-card[data-type="cloud"]::before,
.connection-card.type-sharedrive::before,
.connection-card.type-cloud::before {
    background: linear-gradient(180deg, #0078d4 0%, #0052a3 100%);
}

.connection-card[data-type="sharedrive"],
.connection-card[data-type="cloud"],
.connection-card.type-sharedrive,
.connection-card.type-cloud {
    background: linear-gradient(135deg, #e0f2fe 0%, #ffffff 100%);
    border-color: #a5d8ff;
}

/* Local Files/Directories - Slate */
.connection-card[data-type="file"]::before,
.connection-card[data-type="directory"]::before,
.connection-card.type-file::before,
.connection-card.type-directory::before {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
}

.connection-card[data-type="file"],
.connection-card[data-type="directory"],
.connection-card.type-file,
.connection-card.type-directory {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-color: #e2e8f0;
}

/* Hover State */
.connection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08),
                0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #a1a1aa;
}

/* Status Variants */
.connection-card.status-active {
    border-width: 1.5px;
}

.connection-card.status-error {
    border-color: #fca5a1;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.connection-card.status-error::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.connection-card.status-processing {
    border-color: #fde68a;
    background: linear-gradient(135deg, #fefce8 0%, #ffffff 100%);
}

.connection-card.status-processing::before {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    animation: pulse-processing 2s infinite;
}

@keyframes pulse-processing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-right: 50px;
}

.card-title-section {
    flex: 1;
}

.card-title-section h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 4px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.card-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #86868b;
    font-weight: 500;
}

.card-type-icon {
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════════════════════════ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-badge.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-pending {
    background: #e0f2fe;
    color: #0c4a6e;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD BODY & METADATA
   ═══════════════════════════════════════════════════════════════════════════ */

.card-body {
    margin-bottom: 16px;
}

.card-metadata {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metadata-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #86868b;
    line-height: 1.4;
}

.metadata-row strong {
    color: #515154;
    font-weight: 600;
    min-width: 80px;
}

/* Live Telemetry */
.telemetry-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f2f2f7;
}

.latency-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 10px;
    background: #f5f5f7;
    border-radius: 12px;
    color: #515154;
    font-weight: 500;
}

.latency-icon {
    font-size: 14px;
}

/* Latency color coding */
.latency-good { color: #10b981; }
.latency-medium { color: #f59e0b; }
.latency-poor { color: #ef4444; }

.last-tested {
    font-size: 11px;
    color: #a1a1aa;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CAPACITY PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.capacity-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f2f2f7;
}

.capacity-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.capacity-text {
    color: #86868b;
    font-weight: 500;
}

.capacity-count {
    color: #515154;
    font-weight: 600;
}

.capacity-bar {
    height: 6px;
    background: #f2f2f7;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Animated shimmer effect */
.capacity-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CIRCULAR PLAY BUTTON (Primary Action)
   ═══════════════════════════════════════════════════════════════════════════ */

.play-button-container {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.play-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3),
                0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.play-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.play-button:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4),
                0 4px 12px rgba(0, 0, 0, 0.15);
}

.play-button:hover::before {
    opacity: 1;
}

.play-button:active {
    transform: scale(0.98);
}

.play-icon {
    font-size: 24px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulsing animation for processing state */
.play-button.processing {
    animation: pulse-play 1.5s infinite;
    pointer-events: none;
}

@keyframes pulse-play {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3),
                    0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6),
                    0 4px 16px rgba(0, 0, 0, 0.2);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD ACTIONS (Secondary Buttons)
   ═══════════════════════════════════════════════════════════════════════════ */

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f2f2f7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHECKBOX (Multi-Select)
   ═══════════════════════════════════════════════════════════════════════════ */

.card-checkbox {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS (Apple HIG Style)
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.btn-primary:hover {
    background: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d1d1d6;
}

.btn-secondary:hover {
    background: #e8e8ed;
    border-color: #a1a1aa;
}

.btn-danger {
    background: #ff3b30;
    color: white;
}

.btn-danger:hover {
    background: #e6322c;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

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

.btn-warning {
    background: #ff9500 !important;
    color: white !important;
}

.btn-warning:hover {
    background: #e68600 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════ */

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #86868b;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #f2f2f7;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: #86868b;
    font-size: 16px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #d1d1d6;
}

.empty-state::before {
    content: '🔌';
    display: block;
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM & CONNECTION TYPE SELECTOR
   ═══════════════════════════════════════════════════════════════════════════ */

.add-connection {
    background: rgba(255, 255, 255, 0.98);
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
                0 2px 8px rgba(0, 0, 0, 0.04);
}

.add-connection h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 24px;
}

.connection-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.type-btn {
    background: #f5f5f7;
    border: 1.5px solid #d1d1d6;
    border-radius: 10px;
    padding: 18px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #1d1d1f;
}

.type-btn:hover {
    border-color: #667eea;
    background: #fafbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.type-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.type-btn .icon {
    font-size: 28px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .connections-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .connections-grid {
        grid-template-columns: 1fr;
    }

    .connection-type-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-actions {
        flex-direction: column;
    }

    .btn-small {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .connection-type-selector {
        grid-template-columns: 1fr;
    }

    .play-button {
        width: 48px;
        height: 48px;
    }

    .play-icon {
        font-size: 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RE-SCAN CONTROLS (Directory Cards)
   ═══════════════════════════════════════════════════════════════════════════ */

.rescan-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rescan-lib-select {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #d1d1d6;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    color: #1d1d1f;
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UNIFY TOOLBAR (Multi-Select Actions)
   ═══════════════════════════════════════════════════════════════════════════ */

.unify-toolbar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 16px 32px;
    border-radius: 30px;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3),
                0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    border: 2px solid #667eea;
}

.unify-toolbar.visible {
    bottom: 40px;
}

#unify-count {
    font-weight: 700;
    color: #1d1d1f;
    font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 11000;
}

.toast {
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    max-width: 400px;
    border: 1px solid #d1d1d6;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ff3b30;
}

.toast-info {
    border-left: 4px solid #667eea;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP DIRECTORY (THREE-CATEGORY LAYOUT)
   ═══════════════════════════════════════════════════════════════════════════ */

.app-directory {
    background: rgba(255, 255, 255, 0.98);
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.directory-category {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    border: 2px solid #e2e8f0;
}

.category-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.category-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.category-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 5px 0;
}

.category-header p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.app-tiles {
    display: grid;
    gap: 12px;
}

.app-tile {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.app-tile:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.tile-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.tile-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.tile-desc {
    font-size: 12px;
    color: #64748b;
}

.app-tile.enterprise-badge {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.app-tile .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPRING-LOADED CONNECTION DRAWER (ACCORDION)
   ═══════════════════════════════════════════════════════════════════════════ */

.connection-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.5s ease;
    margin-top: 0;
}

.drawer-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.drawer-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.close-drawer {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-drawer:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-group small {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #3b82f6;
    padding: 14px 28px;
    border-radius: 8px;
    border: 2px solid #3b82f6;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #eff6ff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHIMMER ANIMATION
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #1e293b;
}

.modal-body {
    padding: 30px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COLOR-CODED CONNECTION BORDERS
   ═══════════════════════════════════════════════════════════════════════════ */

.connection-card[data-type="mongodb"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    border-radius: 12px 0 0 12px;
}

.connection-card[data-type="postgresql"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px 0 0 12px;
}

.connection-card[data-type="files"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
    border-radius: 12px 0 0 12px;
}

.connection-card[data-type="sharepoint"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #0078d4 0%, #005a9e 100%);
    border-radius: 12px 0 0 12px;
}
