/* General Styles */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --info-color: #0dcaf0;
}

body {
    padding-top: 76px;
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar .container,
.footer .content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.2rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff;
    background-color: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.card-title {
    color: #2c3e50;
    font-weight: 600;
}

/* Search Box */
.input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.input-group .form-control {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

.input-group .btn {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    color: white !important;
}

/* Features Cards */
.card .bi {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
}

.table-responsive {
    margin-bottom: 1rem;
}

/* Export Section */
.btn-group {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.btn-group .btn {
    margin-bottom: 0.25rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    margin: auto;
    width: 100%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    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 width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="20" height="20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
    opacity: 0.1;
}

.hero-section h1 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    line-height: 1.4;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-section h1 br {
    display: block;
    content: "";
    margin: 10px 0;
}

.hero-section .lead {
    font-size: 1.25rem;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Section */
.search-section {
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}

.search-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
    transition: transform 0.3s ease;
}

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

.search-help {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.url-example {
    display: block;
    background-color: #e9ecef;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    word-break: break-all;
    direction: ltr;
}

/* Features Section */
.feature-card {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: #0d47a1;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.feature-card p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Analysis Section */
.analysis-card {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

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

.analysis-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-list li {
    margin-bottom: 1rem;
    padding-right: 2rem;
    position: relative;
    font-size: 1.1rem;
}

.analysis-list li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Testimonials Section */
.testimonial-card {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

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

.testimonial-content {
    position: relative;
    padding-top: 1rem;
}

.testimonial-content::before {
    content: '"';
    position: absolute;
    top: -1rem;
    right: -0.5rem;
    font-size: 4rem;
    color: #0d47a1;
    opacity: 0.1;
}

.testimonial-author {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.testimonial-author strong {
    display: block;
    color: #2c3e50;
}

.testimonial-author span {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-card {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-info i {
    color: #0d47a1;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer .navbar-nav {
    margin: 0;
}

.footer .nav-link {
    padding: 0.5rem 1rem;
    color: rgba(255,255,255,0.9) !important;
}

.footer .nav-link:hover {
    color: #ffffff !important;
}

/* Buttons */
.btn-primary {
    background-color: #0d46a1;
    border-color: #0d47a1;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #1565c0;
    border-color: #1565c0;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .search-section {
        margin-top: -2rem;
    }
    
    .feature-card,
    .analysis-card,
    .testimonial-card {
        margin-bottom: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.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);
    }
}

/* RTL Specific */
[dir="rtl"] .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-right: -1px;
    margin-left: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

[dir="rtl"] .input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu),
[dir="rtl"] .input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n+3) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Search Results */
#searchResultsContent {
    max-height: 500px;
    overflow-y: auto;
}

/* Field Selection */
.form-check {
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.form-check:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Alert Customization */
.alert-info {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.alert-info code {
    background-color: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

/* Highlight */
mark {
    background-color: #ffd700;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}

/* Tender Details Styling */
.tender-details-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tender-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.tender-details-section {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tender-details-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.tender-details-value {
    font-size: 1.3rem;
    font-weight: 500;
    color: #2c3e50;
}

.site-title {
    color: #2c3e50;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Tender Details and Export Section */
#tenderDetails, #exportSection {
    transition: all 0.3s ease;
}

/* Results Page Specific Styles */
#tenderDetails {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

#tenderDetails:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#tenderDetails .col-md-4 {
    margin-bottom: 1rem;
}

#tenderDetails strong {
    color: #0d47a1;
    font-weight: 600;
}

#chartsContainer {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

.chart-wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 1rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.chart-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.chart-title {
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

#resultsContainer {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
    color: white;
    border: none;
    padding: 1rem;
}

.table tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e8eaf6;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d47a1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Error Messages */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #c62828;
}

/* Success Messages */
.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #2e7d32;
}

/* Tender Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-closed {
    background-color: #ffebee;
    color: #c62828;
}

.status-pending {
    background-color: #fff3e0;
    color: #ef6c00;
}

/* Responsive Adjustments for Results Page */
@media (max-width: 768px) {
    #tenderDetails,
    #chartsContainer,
    #resultsContainer {
        padding: 1rem;
    }

    .chart-wrapper {
        margin-bottom: 1rem;
    }

    .table-responsive {
        margin-bottom: 0;
    }

    .table td,
    .table th {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

.container-fluid {
    padding-top: 2rem;
}

#tenderDetails strong,
.chart-title,
.btn-primary {
    color: #0d47a1;
}

.highlight-number {
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}
