/* Custom CSS for E-rate Opportunity Viewer by USA Telecom Consulting, LLC */

/* Using Replit's bootstrap dark theme, this CSS only provides additional styling */

/* USA Telecom Brand Colors 
 * Primary: #0d6efd (Bootstrap primary)
 * Secondary: #6c757d (Bootstrap secondary)
 * Accent: #0dcaf0 (Bootstrap info)
 * Success: #198754 (Bootstrap success)
 * Warning: #ffc107 (Bootstrap warning)
 * Danger: #dc3545 (Bootstrap danger)
 */

/* Enhanced dark theme with depth */
:root {
    --dark-gradient-start: rgba(33, 37, 41, 0.97);
    --dark-gradient-end: rgba(25, 28, 32, 0.97);
    --surface-color: rgba(45, 50, 56, 0.8);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(10px);
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    --hover-transform: translateY(-5px);
}

/* Body background with subtle texture */
body {
    background: linear-gradient(to bottom right, var(--dark-gradient-start), var(--dark-gradient-end));
    background-attachment: fixed;
    position: relative;
}

/* Add subtle noise texture overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

/* General spacing and layout adjustments */
.content-section {
    margin-bottom: 2rem;
}

.search-container {
    margin-bottom: 2rem;
}

/* Dashboard stats cards */
.dashboard-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    min-height: 200px;
}

.dashboard-card .card-background {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: var(--card-shadow);
}

.dashboard-card .card-inner {
    position: relative;
    z-index: 1;
}

.dashboard-card:hover {
    transform: var(--hover-transform);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.dashboard-card .display-4 {
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.05em;
}

.stats-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.opacity-85 {
    opacity: 0.85;
}

.opacity-10 {
    opacity: 0.1;
}

.rounded-4 {
    border-radius: 1rem;
}

.result-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Custom card styles */
.erate-card {
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.erate-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.erate-card .card-header {
    font-weight: 600;
}

/* Form styling */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-label {
    font-weight: 500;
}

.form-text {
    margin-top: 0.25rem;
}

/* Custom button styles */
.btn-erate {
    transition: all 0.2s ease;
}

.btn-erate:hover {
    transform: translateY(-1px);
}

/* Hero section styling */
.hero-section {
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer styling */
.footer {
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer-link {
    margin: 0 0.5rem;
}

/* Utility classes */
.text-small {
    font-size: 0.875rem;
}

.bg-highlight {
    background-color: rgba(var(--bs-info-rgb), 0.1);
}

.border-highlight {
    border-color: var(--bs-info) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .form-container {
        padding: 0 1rem;
    }
}

/* Animation for loading */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid rgba(var(--bs-info-rgb), 0.3);
    border-radius: 50%;
    border-top-color: var(--bs-info);
    animation: spin 1s ease-in-out infinite;
}

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

/* For search results highlighting */
.keyword-highlight {
    background-color: rgba(var(--bs-warning-rgb), 0.3);
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
}

/* State badge styling */
.state-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: var(--bs-secondary);
    color: var(--bs-light);
    display: inline-block;
    margin-right: 0.5rem;
}

/* Accessibility Improvements */

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--bs-primary);
    color: white;
    padding: 10px 20px;
    z-index: 9999;
    transition: top 0.3s ease;
    text-decoration: none;
    border: 2px solid white;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--bs-warning);
    text-decoration: underline;
}

/* Focus visible styles for better keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--bs-warning) !important;
    outline-offset: 2px !important;
    border-radius: 2px;
}

/* Remove outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Enhance link underlines for better readability */
a {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

/* Improve contrast for card borders */
.card {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Better focus states for cards */
.card:focus-within {
    box-shadow: 0 0 0 3px var(--bs-warning);
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Visible for screen readers but visually hidden until focused */
.sr-only-focusable:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Improved button focus indicators */
button:focus-visible, 
.btn:focus-visible,
input[type="button"]:focus-visible {
    box-shadow: 0 0 0 3px var(--bs-warning) !important;
    outline: none !important;
}

/* Reduce motion for users who prefer reduced motion */
@media (prefers-reduced-motion) {
    * {
        transition: none !important;
        animation: none !important;
    }
    
    .dashboard-card:hover {
        transform: none !important;
    }
    
    .erate-card:hover {
        transform: none !important;
    }
    
    .btn-erate:hover {
        transform: none !important;
    }
    
    .social-btn:hover {
        transform: none !important;
    }
}

/* Improved color contrast */
.text-muted {
    color: #a6a6a6 !important; /* Improved contrast for dark backgrounds */
}

/* Accessible table improvements */
table.table th {
    background-color: var(--bs-dark);
    color: var(--bs-light);
    font-weight: 600;
}

/* Add focus indicator for table rows when using keyboard navigation */
table.table tbody tr:focus-within {
    background-color: rgba(var(--bs-info-rgb), 0.1);
    outline: 2px solid var(--bs-info);
}

/* Make linked cards more accessible */
.card a.stretched-link:focus-visible {
    position: relative;
    z-index: 2;
}

/* Ensure adequate text spacing for readability */
p, li, td, th, label, input, textarea {
    line-height: 1.5;
}

/* New background gradients */
.bg-gradient-dark {
    background: linear-gradient(to right, rgba(33, 37, 41, 0.98), rgba(45, 50, 56, 0.95));
}

.bg-surface {
    background-color: var(--surface-color);
    border-color: var(--border-subtle);
}

/* Enhanced form controls with icons */
.input-group .form-select,
.input-group .form-control {
    padding-left: 0.5rem;
    background-color: rgba(35, 38, 45, 0.8);
}

.input-group-text {
    color: rgba(255, 255, 255, 0.6);
}

.form-select, .form-control {
    transition: all 0.3s ease;
    border-color: var(--border-subtle);
}

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

/* Card styles for opportunity listings */
.opportunity-card {
    height: 100%;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    backdrop-filter: var(--glass-blur);
    background-color: var(--surface-color);
    position: relative;
    z-index: 1; /* Set a lower z-index than dropdowns */
}

.opportunity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--bs-primary), var(--bs-info));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.opportunity-card:hover {
    transform: var(--hover-transform);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(13, 110, 253, 0.4);
}

.opportunity-card:hover::before {
    opacity: 1;
}

.opportunity-card .card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(to right, rgba(25, 28, 32, 0.9), rgba(33, 37, 41, 0.9));
    position: relative;
    overflow: hidden;
}

.opportunity-card .card-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(13, 202, 240, 0.05));
    pointer-events: none;
}

.opportunity-card .card-body {
    padding: 1.5rem;
    background-color: rgba(33, 37, 41, 0.5);
}

.opportunity-card .card-footer {
    padding: 1rem 1.25rem;
    background-color: rgba(25, 28, 32, 0.7);
    border-top: 1px solid var(--border-subtle);
}

.opportunity-card .card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.opportunity-card .card-title a {
    color: var(--bs-light);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
}

.opportunity-card .card-title a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(to right, var(--bs-info), transparent);
    transition: width 0.3s ease;
}

.opportunity-card .card-title a:hover {
    color: var(--bs-info);
}

.opportunity-card .card-title a:hover::after {
    width: 100%;
}

.opportunity-card .card-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

/* Add a subtle highlight for active cards */
.opportunity-card:focus-within {
    border-color: var(--bs-info);
    box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.25);
}

/* Improved state badges */
.opportunity-card .badge {
    padding: 0.4em 0.65em;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* USA Telecom Branding Elements */

/* Header info bar */
.bg-info {
    background-color: var(--bs-info) !important;
}

/* Text color variations */
.text-usa-telecom {
    color: var(--bs-info);
    font-weight: 600;
}

.text-purple {
    color: #a78bfa !important;
}

/* Supplier list enhancements */
.list-unstyled i.fa-check-circle {
    color: var(--bs-success);
}

/* Company info highlight */
.company-highlight {
    border-left: 4px solid var(--bs-info);
    padding-left: 1rem;
}

/* E-rate category badges */
.category-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Social media share buttons */
.social-btn {
    transition: all 0.2s ease;
}

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

.social-btn[data-platform="linkedin"]:hover {
    color: #0077b5 !important;
    border-color: #0077b5 !important;
}

.social-btn[data-platform="twitter"]:hover {
    color: #1da1f2 !important;
    border-color: #1da1f2 !important;
}

.social-btn[data-platform="facebook"]:hover {
    color: #4267B2 !important;
    border-color: #4267B2 !important;
}

.social-btn[data-platform="email"]:hover {
    color: var(--bs-info) !important;
    border-color: var(--bs-info) !important;
}

/* Compliance & legal text */
.legal-text {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--bs-secondary);
}

/* Enhanced deadline warning */
.deadline-warning {
    color: var(--bs-danger);
    font-weight: 600;
}

/* Success indicator */
.success-indicator {
    color: var(--bs-success);
    animation: pulse 2s infinite;
}

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

/* Improved supplier match dropdown styling */
.supplier-badge {
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(13, 202, 240, 0.2);
    background: linear-gradient(to right, rgba(13, 202, 240, 0.9), rgba(13, 110, 253, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.supplier-badge:hover, .supplier-badge:focus {
    background: linear-gradient(to right, rgba(13, 202, 240, 1), rgba(13, 110, 253, 1));
    box-shadow: 0 4px 8px rgba(13, 202, 240, 0.4);
    transform: translateY(-2px);
}

/* Enhanced supplier match button for cards */
.supplier-badge-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
    color: white !important;
    display: inline-flex;
    align-items: center;
    z-index: 3;
    text-decoration: none;
}

/* Default style when no specific confidence class is used */
.supplier-badge-btn:not(.bg-success):not(.bg-info):not(.bg-primary):not(.bg-secondary) {
    background: linear-gradient(to right, rgba(13, 202, 240, 0.9), rgba(13, 110, 253, 0.9));
}

.supplier-badge-btn:not(.bg-success):not(.bg-info):not(.bg-primary):not(.bg-secondary):hover,
.supplier-badge-btn:not(.bg-success):not(.bg-info):not(.bg-primary):not(.bg-secondary):focus {
    background: linear-gradient(to right, rgba(13, 202, 240, 1), rgba(13, 110, 253, 1));
}

/* Style for Very High confidence level */
.supplier-badge-btn.bg-success {
    box-shadow: 0 2px 5px rgba(25, 135, 84, 0.3);
}

/* Style for High confidence level */
.supplier-badge-btn.bg-info {
    box-shadow: 0 2px 5px rgba(13, 202, 240, 0.3);
}

/* Style for Good confidence level */
.supplier-badge-btn.bg-primary {
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

/* Style for Moderate confidence level */
.supplier-badge-btn.bg-secondary {
    box-shadow: 0 2px 5px rgba(108, 117, 125, 0.3);
}

.supplier-badge-btn:hover, .supplier-badge-btn:focus {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
    filter: brightness(110%);
}

.supplier-dropdown {
    width: 320px;
    max-width: 100%;
    border: none;
    border-radius: 0.5rem;
    background-color: rgba(33, 37, 41, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Override Bootstrap dropdown global settings */
.dropdown-menu {
    z-index: 1050 !important; 
}

/* Ensure dropdown container has proper position and z-index */
.dropdown {
    position: relative !important; 
}

.supplier-dropdown .dropdown-header {
    color: var(--bs-info);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.supplier-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.supplier-list .badge {
    transition: all 0.2s ease;
    border-radius: 50px;
    padding: 0.35rem 0.7rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.supplier-list .badge:hover {
    background-color: var(--bs-info) !important;
    color: white !important;
    box-shadow: 0 2px 5px rgba(13, 202, 240, 0.3);
    transform: translateY(-1px);
}

/* Category icons in supplier dropdown */
.supplier-dropdown .text-purple {
    color: #a78bfa !important;
}

.supplier-dropdown i.fa-server {
    color: #a78bfa;
}

.supplier-dropdown i.fa-broadcast-tower {
    color: #60a5fa;
}

.supplier-dropdown i.fa-tools {
    color: #34d399;
}

.supplier-dropdown i.fa-briefcase {
    color: #fbbf24;
}

/* Text truncate for narrative previews */
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.narrative-preview {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--bs-light);
    background-color: rgba(25, 135, 84, 0.1);
    padding: 0.75rem;
    border-radius: 0.25rem;
    border-left: 3px solid var(--bs-success);
}

.bid-requirements-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.bid-requirements-header i {
    color: var(--bs-success);
    margin-right: 0.5rem;
}

.bid-requirements-header strong {
    color: var(--bs-light);
    font-weight: 600;
}
