/* Custom styles that complement Bootstrap and Tailwind */

/* Screen reader only utility */
.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;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Custom animations and transitions */
* {
    transition-timing-function: ease-in-out;
}

/* Section title underline effect */
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #3498db;
}

/* Detail card hover line effect */
.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #3498db;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.detail-card:hover::before {
    transform: translateX(0);
}

/* Team member image effects */
.team-member img {
    filter: grayscale(50%);
    transition: all 0.3s ease;
}

.team-member:hover img {
    filter: grayscale(0%);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Code block styling */
.code-block {
    background: #263238;
    color: #aed581;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    max-width: 100%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Mobile responsiveness for code blocks */
@media (max-width: 768px) {
    .code-block {
        font-size: 0.75rem;
        padding: 1rem !important;
        line-height: 1.4;
        word-break: break-all;
        white-space: pre-wrap;
        overflow-wrap: break-word;
    }
}

@media (max-width: 480px) {
    .code-block {
        font-size: 0.7rem;
        padding: 0.75rem !important;
        line-height: 1.3;
    }
}

/* Ensure code block containers don't overflow on mobile */
@media (max-width: 768px) {
    .quickstart-content,
    .submission-container,
    .submission-step {
        overflow-x: hidden;
    }
    
    .quickstart-content .code-block,
    .submission-step .code-block {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Leaderboard rank medals */
.leaderboard-table tbody tr:nth-child(1) .rank::after {
    content: " 🥇";
    font-size: 0.9rem;
}

.leaderboard-table tbody tr:nth-child(2) .rank::after {
    content: " 🥈";
    font-size: 0.9rem;
}

.leaderboard-table tbody tr:nth-child(3) .rank::after {
    content: " 🥉";
    font-size: 0.9rem;
}

/* Prize tier gradients */
.prize-tier.gold {
    background: linear-gradient(to bottom, #fffdf5, #ffffff);
    border-color: #ffd700 !important;
}

.prize-tier.silver {
    background: linear-gradient(to bottom, #fafafa, #ffffff);
    border-color: #c0c0c0 !important;
}

.prize-tier.bronze {
    background: linear-gradient(to bottom, #fff8f5, #ffffff);
    border-color: #cd7f32 !important;
}

/* Hero gradient */
.hero-gradient {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
}

/* Section gradients */
.section-gradient {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
}

/* Top 3 leaderboard styling */
.leaderboard-table .top-3 {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
}

.leaderboard-table .top-3:hover {
    background: linear-gradient(135deg, #fff7d6 0%, #fff2c6 100%);
}

/* Bootstrap overrides for maintaining aesthetic */
.btn-primary {
    background-color: #3498db !important;
    border-color: #3498db !important;
    border-radius: 25px;
    padding: 0.875rem 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #2c3e50 !important;
    border-color: #2c3e50 !important;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    border-radius: 25px;
    padding: 0.875rem 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
    transform: translateY(-2px);
    color: white !important;
}

/* Fix text colors */
.text-primary {
    color: #2c3e50 !important;
}

.text-accent {
    color: #3498db !important;
}

.text-text-secondary {
    color: #6c757d !important;
}

/* Background colors */
.bg-primary {
    background-color: #2c3e50 !important;
}

.bg-accent {
    background-color: #3498db !important;
}

.bg-white {
    background-color: #ffffff !important;
}

/* Border colors */
.border-accent {
    border-color: #3498db !important;
}

.border-border {
    border-color: #dee2e6 !important;
}

/* Card hover effects */
.card-hover:hover {
    transform: translateY(-3px);
    transition: all 0.3s ease;
}

/* Prize icon animation */
.prize-tier:hover .prize-icon {
    transform: scale(1.2) rotate(5deg);
}

/* FAQ item hover */
.faq-item h3:hover {
    padding-left: 10px;
    transition: all 0.2s ease;
}

/* Contact icon effects */
.contact-icon:hover {
    transform: translateY(-3px);
}

/* Sponsor logo effects */
.sponsor-logo {
    filter: grayscale(0%);
}

.sponsor-logo-link:hover .sponsor-logo {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Responsive adjustments for mobile */
@media (max-width: 640px) {
    .hero-actions .flex {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Hide archive badge on mobile to save space */
    header .logo span {
        display: none;
    }
}

/* Active tab styling */
.tab-button.active {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

/* Table styling that can't be done with Tailwind */
.leaderboard-table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

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

.leaderboard-table td {
    padding: 1rem;
}

.leaderboard-table .rank {
    text-align: center;
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}

.leaderboard-table .team-name {
    font-weight: 600;
    color: #2c3e50;
}

.leaderboard-table .score {
    text-align: center;
    font-weight: 600;
    color: #3498db;
    font-size: 1.05rem;
}