/* SurvAI Custom Styles - Dark Mode Friendly */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --purple-color: #6f42c1;
    --pink-color: #d63384;
    --transition-speed: 0.2s;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    transition: background-color var(--transition-speed);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Card styling */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

[data-bs-theme="dark"] .card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* Card header enhancements */
.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(var(--bs-body-color-rgb), 0.1);
    font-weight: 600;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    transition: color var(--transition-speed);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--primary-color);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all var(--transition-speed);
    border: none;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: var(--primary-color);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: rgba(var(--bs-body-color-rgb), 0.9);
}

.form-text {
    font-size: 0.875rem;
    color: rgba(var(--bs-body-color-rgb), 0.6);
}

/* Input groups */
.input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

/* Survey response scale buttons */
.scale-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.scale-buttons .btn-check:checked + .btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    border-color: var(--primary-color);
}

/* Tables */
.table {
    border-radius: 8px;
    overflow: hidden;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

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

/* Analytics charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Survey preview */
.survey-preview {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.02);
}

[data-bs-theme="dark"] .survey-preview {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: #495057;
}

/* Question list */
.question-item {
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    margin-bottom: 15px;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-active { background-color: var(--success-color); }
.status-pending { background-color: var(--warning-color); }
.status-failed { background-color: var(--danger-color); }

/* Tooltips */
.tooltip-icon {
    cursor: help;
    color: var(--info-color);
    margin-left: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .navbar, .btn, .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
