/* Custom CompareTool Styles */
:root {
    --primary-color: #0066cc;
    --secondary-color: #28a745;
    --accent-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Enhanced Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 1rem 1.5rem;
    border: none;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Enhanced Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:hover:before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #004499);
}

.btn-success {
    background: linear-gradient(135deg, var(--secondary-color), #218838);
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-color), #138496);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
}

/* Form Controls */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.7rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--secondary-color);
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

/* Badges */
.badge {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius);
}

/* Enhanced Layout */
.page-header {
    background: linear-gradient(135deg, var(--dark-color), #495057);
    color: white !important;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0.5rem 0 0 0;
    color: white !important;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: scale(1.05);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.stats-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Navigation Enhancements */
.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: white !important;
}

.navbar-brand:hover {
    color: #f8f9fa !important;
}

.nav-link {
    border-radius: var(--border-radius);
    margin: 0.2rem 0;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(5px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color)) !important;
    box-shadow: var(--shadow);
}

/* Table Enhancements */
.table {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead th {
    background: linear-gradient(135deg, var(--dark-color), #495057);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: rgba(0, 102, 204, 0.05);
}

/* Code/Script Areas */
.script-area {
    background: #2d3748;
    color: #a0aec0;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.script-area:focus {
    background: #2d3748;
    color: #a0aec0;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Progress Bars */
.progress {
    border-radius: var(--border-radius);
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: width 0.6s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Connection Status Indicators */
.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.connection-status.connected {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left: 4px solid var(--secondary-color);
}

.connection-status.disconnected {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--secondary-color);
}

.status-dot.disconnected {
    background: var(--danger-color);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}