/* Faculty Research Matcher - Custom Styles */
/* Based on University of Ottawa design system */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* CSS Custom Properties */
:root {
    --uottawa-red: #8f001a;
    --uottawa-grey: #2c3e50;
    --uottawa-light-grey: #ecf0f1;
    --primary-gradient: linear-gradient(135deg, #8f001a 0%, #b91d33 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --text-primary: #2c3e50;
    --text-muted: #6c757d;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text-primary);
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.7;
}

/* Enhanced Button Styles */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.025em;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7a0016 0%, #a01a2e 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--uottawa-red);
    color: var(--uottawa-red);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--uottawa-red);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 12px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Glass Card Effects */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

.card-header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Hero Section */
.hero-section {
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero-section h1,
.hero-section .display-4 {
    color: white !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.2);
}

.hero-section .lead {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

.hero-stats {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navigation */
.navbar {
    background: rgba(143, 0, 26, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1030;
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.nav-link {
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Dropdown Menu Styles */
.navbar .dropdown-menu {
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    min-width: 150px;
    z-index: 1031;
}

.navbar .dropdown-item {
    color: var(--text-primary);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
    background: var(--uottawa-light-grey);
    color: var(--uottawa-red);
}

.navbar .dropdown-item.active {
    background: var(--uottawa-red);
    color: white;
}

.navbar .dropdown-toggle::after {
    margin-left: 0.5em;
}

/* Feature Icons */
.feature-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Form Enhancements */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-control:focus, .form-select:focus {
    border-color: var(--uottawa-red);
    box-shadow: 0 0 0 0.2rem rgba(143, 0, 26, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Interest Form Specific */
.interest-category {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-title {
    color: var(--uottawa-red);
    font-weight: 600;
    border-bottom: 2px solid rgba(143, 0, 26, 0.1);
    padding-bottom: 0.5rem;
}

.interest-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.interest-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--uottawa-red) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.form-check-input:checked {
    background-color: var(--uottawa-red);
    border-color: var(--uottawa-red);
}

.form-range::-webkit-slider-thumb {
    background: var(--uottawa-red);
}

.form-range::-moz-range-thumb {
    background: var(--uottawa-red);
    border: none;
}

/* Match Results */
.match-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.match-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--uottawa-red);
}

.match-score {
    text-align: center;
}

.match-score .h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--uottawa-red);
}

.faculty-photo img {
    border: 3px solid rgba(143, 0, 26, 0.1);
    transition: all 0.3s ease;
}

.match-card:hover .faculty-photo img {
    border-color: var(--uottawa-red);
    box-shadow: var(--shadow-sm);
}

/* Badges */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
    padding: 0.5em 0.75em;
    border-radius: 6px;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

/* Faculty Browse */
.faculty-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.faculty-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(143, 0, 26, 0.3);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-info {
    background: rgba(13, 202, 240, 0.1);
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #664d03;
    border-left: 4px solid #ffc107;
}

.alert-success {
    background: rgba(25, 135, 84, 0.1);
    color: #0f5132;
    border-left: 4px solid #198754;
}

/* Progress Bar */
.progress {
    background-color: rgba(143, 0, 26, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    transition: width 0.6s ease;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    margin-top: auto;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-animation {
    animation: pulse 2s infinite ease-in-out;
}

/* DNA Strand Animation */
@keyframes dna-float {
    0%, 100% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(3px) translateY(-3px) rotate(2deg);
    }
    50% {
        transform: translateX(0) translateY(-5px) rotate(0deg);
    }
    75% {
        transform: translateX(-3px) translateY(-3px) rotate(-2deg);
    }
}

@keyframes dna-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3), 0 0 30px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 4px 30px rgba(255, 255, 255, 0.5), 0 0 50px rgba(255, 255, 255, 0.3);
    }
}

@keyframes dna-pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.15) rotate(180deg);
    }
}

.btn-find-matches {
    position: relative;
    overflow: visible !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: 3px solid rgba(255, 255, 255, 0.9) !important;
    color: #8f001a !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4), 0 0 30px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-find-matches:hover {
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%) !important;
    border-color: rgba(255, 255, 255, 1) !important;
    color: #8f001a !important;
    box-shadow: 0 6px 30px rgba(255, 255, 255, 0.6), 0 0 50px rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) scale(1.05);
    animation: dna-float 3s ease-in-out infinite, dna-glow 2s ease-in-out infinite;
}

.btn-find-matches .btn-icon {
    display: inline-block;
    color: #0dcaf0;
}

.btn-find-matches:hover .btn-icon {
    animation: dna-pulse 2s ease-in-out infinite;
}

/* Micro-interactions */
@media (hover: hover) {
    .btn:hover {
        transform: translateY(-1px);
    }

    .card:hover {
        transform: translateY(-2px);
    }

    .faculty-card:hover, .match-card:hover {
        transform: translateY(-4px);
    }

    .interest-item:hover {
        transform: translateY(-1px) !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .pulse-animation {
        animation: none;
    }
}

/* Focus States */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(143, 0, 26, 0.25);
    outline: none;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-muted: #333;
    }

    .card {
        border: 2px solid #000;
    }

    .btn-outline-primary {
        border-width: 3px;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .interest-category {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 3rem 0;
    }
}

/* Print Styles */
@media print {
    .navbar, footer, .btn, .alert {
        display: none !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}