:root {
    --primary-color: #24292e;
    --secondary-color: #0366d6;
    --background-color: #ffffff;
    --text-color: #24292e;
    --border-color: #e1e4e8;
    --aws-color: #FF9900;
    --azure-color: #0078D4;
    --gcp-color: #4285F4;
    --ibm-color: #0062FF;
    --alibaba-color: #FF6A00;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

.navbar {
    background-color: var(--primary-color) !important;
    padding: 0.35rem 0;
}

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

.navbar-brand i {
    margin-right: 8px;
    color: #fff;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.text-muted {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.search-container {
    margin-bottom: 0.5rem !important;
}

.search-container .input-group {
    max-width: 600px;
    margin: 0 auto;
}

.input-group-text {
    background-color: #fafbfc;
    border-right: none;
}

.form-control {
    border-left: none;
}

.form-control:focus {
    box-shadow: none;
    border-color: var(--border-color);
}

/* GitHub Stats Buttons */
.github-stats {
    text-align: center;
    margin: 2rem 0;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    background-color: #fafbfc;
    margin: 0 4px;
    transition: all 0.2s;
}

.github-btn:hover {
    background-color: #f3f4f6;
    text-decoration: none;
    color: var(--text-color);
}

.github-btn i {
    margin-right: 4px;
}

.github-btn span {
    display: inline-block;
    padding: 2px 5px;
    margin-left: 4px;
    font-size: 12px;
    font-weight: 600;
    background-color: #fff;
    border-radius: 20px;
}

.sponsor-btn {
    color: #db61a2;
    border-color: #db61a2;
}

.sponsor-btn:hover {
    color: #fff;
    background-color: #db61a2;
}

/* Enhanced Table Styles */
.comparison-table {
    border: 1px solid var(--border-color);
    margin: 2rem 0 4rem 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 0.5rem;
}

.comparison-table th {
    background-color: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    color: #1a202c;
    letter-spacing: 0.3px;
}

.comparison-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    vertical-align: middle;
    background-color: var(--background-color);
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.comparison-table th:nth-child(1),
.comparison-table td:nth-child(1) {
    background-color: #ffffff; /* Add a white background */
    position: sticky;
    left: 0;
    z-index: 1; /* Ensure it stays on top of other cells */
    box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.2); /* Add a subtle shadow */
}

/* Category styling */
.category-row {
    background: linear-gradient(to right, #f1f5f9, #f8fafc) !important;
    font-weight: 600;
    font-size: 1.1rem;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    position: relative;
}

/* Row hover effects */
.comparison-table tr:not(.category-row):hover td {
    background-color: #f8fafc;
}

/* Service link enhancements */
.service-link {
    color: var(--secondary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.service-link:hover {
    background-color: rgba(3, 102, 214, 0.1);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Footer styling */
footer {
    background: linear-gradient(to right, #1a202c, #2d3748);
    color: #e2e8f0;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-section {
    margin-bottom: 2rem;
}

.footer-section h5 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h5::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--secondary-color);
}

.footer-section p {
    color: #cbd5e0;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

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

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #a0aec0;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    color: #cbd5e0;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.social-links a:hover {
    color: #fff;
    transform: translateY(-2px);
}

/* Sticky columns desktop enhancements */
@media (min-width: 769px) {
    .comparison-table {
        position: relative;
        overflow: auto;
    }

    /* First column (Category) */
    .comparison-table th:nth-child(1),
    .comparison-table td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 2;
        background-color: #fff;
    }

    .comparison-table th:nth-child(1) {
        z-index: 3;
        background-color: #f8fafc;
    }

    /* Second column (Service) */
    .comparison-table th:nth-child(2),
    .comparison-table td:nth-child(2) {
        position: sticky;
        left: 120px;
        z-index: 2;
        background-color: #fff;
    }

    .comparison-table th:nth-child(2) {
        z-index: 3;
        background-color: #f8fafc;
    }

    /* Add shadow for better visual separation */
    .comparison-table td:nth-child(2),
    .comparison-table th:nth-child(2) {
        box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.05);
    }

    /* Ensure proper background for category rows */
    .comparison-table tr.category-header td:nth-child(1),
    .comparison-table tr.category-header td:nth-child(2) {
        background: linear-gradient(to right, #f1f5f9, #f8fafc);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h5::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-links {
        justify-content: center;
    }

    .comparison-table {
        border: none;
        box-shadow: none;
    }

    .comparison-table thead {
        display: none; /* Hide table headers on mobile */
    }

    .comparison-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        background: #fff;
    }

    /* Style for category rows */
    .comparison-table tr.category-header {
        background: linear-gradient(to right, #f1f5f9, #f8fafc);
        padding: 1rem;
        margin: 2rem 0 1rem;
        border-radius: 8px;
        font-weight: 600;
        font-size: 1.1rem;
        color: #0f172a;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: none;
    }

    .comparison-table tbody tr:not(.category-header) {
        padding: 1rem;
        border: 1px solid #e2e8f0;
    }

    .comparison-table td {
        display: block;
        padding: 0.5rem 0;
        border: none;
        position: relative;
    }

    /* Hide category and service cells if they're empty */
    .comparison-table td:empty {
        display: none;
    }

    /* Style for service name */
    .comparison-table td:nth-child(2) {
        font-size: 1.1rem;
        font-weight: 600;
        color: #1a202c;
        padding-bottom: 1rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid #e2e8f0;
    }

    /* Provider cards */
    .provider-card {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        padding: 0.75rem;
        margin: 0.5rem 0;
        border-radius: 6px;
        background: #f8fafc;
    }

    .provider-card img {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

    .provider-card .provider-name {
        font-weight: 500;
        color: #64748b;
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .provider-card .service-link {
        padding: 0;
        color: var(--secondary-color);
    }

    /* Tooltip adjustments for mobile */
    .service-tooltip .tooltip-content {
        width: calc(100% - 2rem);
        left: 1rem;
        transform: none;
        bottom: 100%;
        margin-bottom: 0.5rem;
    }

    .service-tooltip .tooltip-content::after {
        left: 1rem;
        margin-left: 0;
    }

    .navbar {
        padding: 0.35rem 0;
    }

    .container.mt-4 {
        margin-top: 0.5rem !important;
    }

    h1 {
        font-size: 1.5rem;
    }

    .filters-container {
        padding: 0.75rem;
    }

    .filter-group:not(:last-child) {
        margin-bottom: 0.75rem;
    }
}

/* Service Items */
.service-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Category Row */
.category-row {
    background-color: #f6f8fa;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .github-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .github-btn {
        margin: 4px;
    }

    .comparison-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .service-icon {
        width: 20px;
        height: 20px;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 9999;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    line-height: 1.4;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Provider-specific styles */
.aws-service { color: var(--aws-color); }
.azure-service { color: var(--azure-color); }
.gcp-service { color: var(--gcp-color); }
.ibm-service { color: var(--ibm-color); }
.alibaba-service { color: var(--alibaba-color); }

/* Provider logo size fix */
.provider-logo {
    height: 28px;
    max-width: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Table responsive container */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    position: relative;
}

/* Filter Styles */
.filters-container {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
}

/* Make the category filter group smaller but not too small */
.filter-group:first-child {
    min-width: 250px;
    width: 250px;
}

/* Allow provider filter group to take remaining space */
.filter-group:last-child {
    flex: 1;
}

.filter-group label {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

#categoryFilter {
    width: 100%;
}

.provider-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.1rem;
}

.provider-filter-buttons .btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    background-color: #fff;
    border: 1px solid #e2e8f0;
}

.provider-filter-buttons .btn.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.provider-filter-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Add hover effect for provider logos */
.provider-logo:hover {
    transform: scale(1.1); /* Slightly enlarge the icon */
    transition: transform 0.3s ease; /* Smooth transition effect */
    filter: brightness(1.2); /* Brighten the image on hover */
    cursor: pointer; /* Change cursor to pointer */
}

/* Tooltip Styles */
.service-tooltip {
    position: relative;
    cursor: pointer;
}

.service-tooltip .tooltip-content {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    background: #2d3748;
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    width: 220px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.service-tooltip .tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

.service-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--secondary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #0056b3;
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .provider-filter-buttons {
        justify-content: flex-start;
    }
    
    .provider-filter-buttons .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* Skeleton Loader */
.skeleton-loader {
    animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
    0% {
        background-color: rgba(129, 140, 248, 0.1);
    }
    100% {
        background-color: rgba(129, 140, 248, 0.2);
    }
}

.skeleton-row {
    display: flex;
    margin: 10px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.skeleton-cell {
    height: 20px;
    background: #eee;
    border-radius: 4px;
    margin-right: 20px;
}

.skeleton-cell:nth-child(1) { width: 120px; }
.skeleton-cell:nth-child(2) { width: 200px; }
.skeleton-cell:nth-child(3) { width: 150px; }
.skeleton-cell:nth-child(4) { width: 180px; }

/* Service Status Indicators */
.service-status {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 6px;
}

.status-ga {
    background-color: #dcfce7;
    color: #166534;
}

.status-beta {
    background-color: #fff7ed;
    color: #9a3412;
}

.status-preview {
    background-color: #eff6ff;
    color: #1e40af;
}

/* Enhanced Animations */
.filters-container {
    transition: all 0.3s ease;
}

.provider-filter-buttons .btn {
    transition: all 0.2s ease;
    transform: translateY(0);
}

.provider-filter-buttons .btn:hover {
    transform: translateY(-2px);
}

.provider-filter-buttons .btn.active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Service Card Hover Effects */
.service-item {
    transition: all 0.2s ease;
}

.service-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Print Styles */
@media print {
    .filters-container,
    .back-to-top,
    .navbar {
        display: none !important;
    }

    .comparison-table {
        width: 100% !important;
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }
}

/* Main Content Spacing */
.container.mt-4 {
    margin-top: 0.5rem !important;
}

/* Mobile styles */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
    }

    .filter-group:first-child {
        min-width: 100%;
        width: 100%;
    }

    .filter-group:last-child {
        width: 100%;
    }

    .provider-filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        width: 100%;
    }

    .provider-filter-buttons .btn {
        flex: 1 1 auto;
        min-width: calc(33.333% - 0.35rem); /* 3 buttons per row with gap */
        text-align: center;
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }

    .mobile-service {
        display: block; /* Stack services vertically */
        margin-bottom: 5px; /* Add some spacing between services */
    }

    .provider-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .provider-name {
        font-size: 0.8em;
        font-weight: bold;
        margin-bottom: 2px;
    }
}

/* Service Description Container */
#service-description-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(34, 40, 49, 0.9); /* Dark translucent background */
    color: #fff;
    padding: 0.75rem 1rem; /* Reduced padding */
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.1s ease-in, /* Quick fade-in */
        visibility 0.1s ease-in,
        transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* "Pop-up" animation */
    z-index: 1000;
    box-shadow: 0px -5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(100%); /* Start hidden below the screen */
}

#service-description-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Slide up into view */
    transition:
        opacity 0.5s ease-out, /* Slow fade-out */
        visibility 0.5s ease-out,
        transform 0.3s ease-out; /* Slide back down */
}

#service-description-content {
    max-width: 800px; /* Reduced max-width */
    margin: 0 auto;
    text-align: center; /* Center the content */
}

#service-description-title {
    font-size: 1.1rem; /* Reduced font-size */
    font-weight: 600;
    margin-bottom: 0.25rem; /* Reduced margin */
    color: #fff;
}

#service-description-text {
    font-size: 0.85rem; /* Reduced font-size */
    line-height: 1.4;
    color: #ddd;
}