/* Modern SSH Configuration Manager - Improved UI/UX */
/* Industry Standard Design with Proper Typography */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Modern and Accessible */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #818cf8;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Font Sizes - Responsive and Readable */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;      /* 14px */
    --font-size-base: 1rem;        /* 16px - Base */
    --font-size-lg: 1.125rem;      /* 18px */
    --font-size-xl: 1.25rem;       /* 20px */
    --font-size-2xl: 1.5rem;       /* 24px */
    --font-size-3xl: 1.875rem;     /* 30px */
    --font-size-4xl: 2.25rem;      /* 36px */
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Spacing Scale - 8px base unit */
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    
    /* Border Radius */
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--gray-900);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--spacing-6) 0;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-8);
    border-bottom: 1px solid var(--gray-200);
}

.navbar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-6);
}

.navbar h1 {
    color: var(--primary-color);
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-2);
    letter-spacing: -0.02em;
}

.navbar .subtitle {
    color: var(--gray-600);
    font-size: var(--font-size-base);
    font-weight: 400;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-6);
    padding-bottom: var(--spacing-12);
}

/* Sections */
.section {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-8);
    margin-bottom: var(--spacing-8);
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition-base);
}

.section:hover {
    box-shadow: var(--shadow-xl);
}

.section h2 {
    color: var(--primary-color);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--spacing-6);
    padding-bottom: var(--spacing-4);
    border-bottom: 3px solid var(--primary-color);
    letter-spacing: -0.01em;
}

.section h3 {
    color: var(--gray-800);
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-top: var(--spacing-8);
    margin-bottom: var(--spacing-4);
}

/* Host Cards Grid */
.hosts-grid, .npm-hosts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--spacing-6);
    margin-top: var(--spacing-6);
}

/* Host Card */
.host-card, .npm-host-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-6);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.host-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.host-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.host-card:hover::before {
    opacity: 1;
}

/* Host Header */
.host-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-5);
    padding-bottom: var(--spacing-4);
    border-bottom: 1px solid var(--gray-200);
}

.host-name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.host-role {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

/* Host Details */
.host-detail {
    margin: var(--spacing-3) 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-2) 0;
    border-bottom: 1px solid var(--gray-100);
}

.host-detail:last-child {
    border-bottom: none;
}

.host-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.host-value {
    color: var(--gray-900);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    font-weight: 500;
    background: white;
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

/* Info Boxes */
.info-box, .warning-box {
    padding: var(--spacing-4);
    margin: var(--spacing-4) 0;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

.info-box {
    background: #eff6ff;
    border-left: 4px solid var(--info-color);
    color: #1e40af;
}

.warning-box {
    background: #fffbeb;
    border-left: 4px solid var(--warning-color);
    color: #92400e;
}

/* SSH Section */
.ssh-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid var(--warning-color);
    padding: var(--spacing-5);
    margin: var(--spacing-5) 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.ssh-section strong {
    color: var(--gray-800);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: var(--spacing-3);
}

/* NPM Section */
.npm-section {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid var(--info-color);
    padding: var(--spacing-5);
    margin: var(--spacing-5) 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.npm-section strong {
    color: var(--gray-800);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: var(--spacing-3);
}

/* Buttons */
.actions-grid {
    display: flex;
    gap: var(--spacing-4);
    flex-wrap: wrap;
    margin-top: var(--spacing-6);
}

.btn {
    padding: var(--spacing-4) var(--spacing-6);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    letter-spacing: 0.01em;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, var(--info-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-sm);
}

.status-enabled {
    background: #d1fae5;
    color: #065f46;
}

.status-disabled {
    background: #fee2e2;
    color: #991b1b;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: var(--spacing-8);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--gray-400);
    float: right;
    font-size: var(--font-size-3xl);
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}

.close:hover {
    color: var(--gray-900);
}

.modal-content h2 {
    color: var(--primary-color);
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-6);
    padding-bottom: var(--spacing-4);
    border-bottom: 3px solid var(--primary-color);
}

.modal-content h3 {
    color: var(--gray-800);
    font-size: var(--font-size-xl);
    margin-top: var(--spacing-8);
    margin-bottom: var(--spacing-4);
}

/* Code Blocks */
.code-block {
    background: var(--gray-900);
    color: #10b981;
    border: 1px solid var(--gray-700);
    border-radius: var(--radius-md);
    padding: var(--spacing-4);
    margin: var(--spacing-3) 0;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    line-height: var(--line-height-relaxed);
}

/* Alternative Methods */
.alternative-method {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-6);
    margin: var(--spacing-6) 0;
    transition: all var(--transition-base);
}

.alternative-method:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.alternative-method h3 {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-3);
}

.alternative-method p {
    color: var(--gray-600);
    font-size: var(--font-size-base);
    margin: var(--spacing-3) 0;
    line-height: var(--line-height-relaxed);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-4);
    }
    
    .navbar {
        padding: var(--spacing-4) 0;
    }
    
    .navbar h1 {
        font-size: var(--font-size-2xl);
    }
    
    .section {
        padding: var(--spacing-6);
    }
    
    .section h2 {
        font-size: var(--font-size-xl);
    }
    
    .hosts-grid, .npm-hosts-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-4);
    }
    
    .host-card, .npm-host-card {
        padding: var(--spacing-4);
    }
    
    .host-name {
        font-size: var(--font-size-lg);
    }
    
    .actions-grid {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        padding: var(--spacing-6);
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 0.9375rem; /* 15px */
    }
    
    .navbar h1 {
        font-size: var(--font-size-xl);
    }
    
    .host-name {
        font-size: var(--font-size-base);
    }
    
    .host-value {
        font-size: var(--font-size-xs);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States for Keyboard Navigation */
.btn:focus,
.close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.host-card:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .navbar {
        box-shadow: none;
        border-bottom: 2px solid var(--gray-300);
    }
    
    .section {
        box-shadow: none;
        border: 1px solid var(--gray-300);
        page-break-inside: avoid;
    }
    
    .btn {
        display: none;
    }
    
    .modal {
        display: none;
    }
}
