/* DerryCTF Home Page Styles */

/* Hero section with background image */
.hero-section {
    padding: 3.5rem 0;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('/images/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    min-height: 35vh;
}

.hero-logo {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.hero-logo .text-accent {
    color: var(--ctf-primary);
}

.hero-tagline {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 500px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-text {
    color: var(--ctf-gray);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.category-item {
    background-color: var(--ctf-light);
    border: 1px solid var(--ctf-border);
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-item:hover {
    border-color: var(--ctf-primary);
    background-color: rgba(13, 110, 253, 0.08);
}

/* Rules List */
.rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: rule-counter;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--ctf-border);
    color: #333;
    font-size: 0.95rem;
    line-height: 1.6;
    counter-increment: rule-counter;
}

.rule-item::before {
    content: counter(rule-counter) ".";
    font-weight: 700;
    color: var(--ctf-primary);
    min-width: 1.5rem;
}

.rule-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rule-item:first-child {
    padding-top: 0;
}

/* Chart container styles for public profile */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background: #ffffff;
    border-radius: 6px;
}

#progressChart {
    height: 350px !important;
    font-family: 'Josefin Sans', sans-serif !important;
}

/* Chart card styling - only target chart containers */
.card .chart-container {
    padding: 15px;
    background: #ffffff;
}

.card .chart-container .card-body {
    background-color: #ffffff;
}

.card-header h5 i {
    color: var(--ctf-primary, #007bff);
}

/* CTF-style chart styling */
.chart-container canvas {
    border-radius: 4px;
    background: #ffffff;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-family: 'Josefin Sans', sans-serif;
}

.card-header h5 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
}

/* Profile stats styling */
.card .h3, .card .h4 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
}

.card small.text-muted {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 500;
}

/* Table styling for recent solves */
.table th {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    border-top: none;
    background-color: #f8f9fa;
    color: #495057 !important; /* Ensure table headers are visible */
}

.table td {
    font-family: 'Josefin Sans', sans-serif;
    color: #212529 !important; /* Ensure table data is visible */
}

.table .fw-semibold {
    font-weight: 600;
}

.table .fw-bold {
    font-weight: 700;
}

/* Ensure badges in tables are properly styled */
.table .badge {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 500;
}

/* Specific badge colors to ensure they're visible */
.table .badge.bg-success {
    background-color: #198754 !important;
    color: #ffffff !important;
}

.table .badge.bg-primary {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

.table .badge.bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

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

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

.table .badge.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.table .badge.bg-dark {
    background-color: #212529 !important;
    color: #ffffff !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-logo {
        font-size: 2.5rem;
    }

    .hero-tagline {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .hero-section {
        padding: 2.5rem 0;
        min-height: 30vh;
    }

    .category-list {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    #progressChart {
        height: 250px !important;
    }
    
    /* Responsive countdown */
    .countdown-display {
        padding: 1rem;
        margin: 0.75rem 0;
    }
    
    .countdown-title {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    
    .countdown-timer {
        gap: 0.5rem;
    }
    
    .countdown-unit {
        padding: 0.5rem 0.65rem;
        min-width: 58px;
    }
    
    .countdown-value {
        font-size: 1.4rem;
    }
    
    .countdown-label {
        font-size: 0.6rem;
        margin-top: 0.25rem;
    }
}

/* Competition Status Banner */
.competition-status-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-family: 'Josefin Sans', sans-serif;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: 'Josefin Sans', sans-serif;
    line-height: 1;
}

.status-badge i {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.status-badge.status-waiting {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.status-badge.status-running {
    background: rgba(13, 110, 253, 0.2);
    color: var(--ctf-primary);
    border: 1px solid rgba(13, 110, 253, 0.4);
}

.status-badge.status-ended {
    background: rgba(108, 117, 125, 0.2);
    color: #adb5bd;
    border: 1px solid rgba(108, 117, 125, 0.4);
}

/* Countdown Display */
.countdown-display {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
}

.countdown-title {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.85rem;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.countdown-unit {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    min-width: 65px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.countdown-value {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ctf-primary);
    line-height: 1;
    letter-spacing: 0.5px;
}

.countdown-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.65rem;
    color: var(--ctf-gray);
    text-transform: uppercase;
    margin-top: 0.35rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.freeze-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: rgba(13, 110, 253, 0.2);
    color: var(--ctf-primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Josefin Sans', sans-serif;
}

.freeze-badge i {
    animation: snowflake-spin 3s linear infinite;
}

@keyframes snowflake-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Recent Joins Section */
.recent-joins-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recent-join-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ctf-border);
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.recent-join-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-join-item:first-child {
    padding-top: 0;
}

.recent-join-item strong {
    color: #333;
}

.join-time {
    color: var(--ctf-gray);
}


/* Team Section Styles */
.team-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--ctf-light, #f8f9fa);
    border: 1px solid var(--ctf-border, #dee2e6);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.team-member:hover {
    border-color: var(--ctf-primary, #0d6efd);
    background: rgba(13, 110, 253, 0.05);
}

.team-avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.team-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--ctf-primary, #0d6efd), #0056b3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.team-avatar i {
    font-size: 1.25rem;
    color: white;
}

.team-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.25rem 0;
}

.team-info p {
    font-size: 0.85rem;
    color: var(--ctf-gray, #6c757d);
    margin: 0;
}

.team-cta {
    padding-top: 1rem;
    border-top: 1px solid var(--ctf-border, #dee2e6);
    text-align: center;
}

.team-cta .section-text {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .team-member {
        flex-direction: column;
        text-align: center;
    }
    
    .team-avatar,
    .team-avatar-img {
        margin: 0 auto;
    }
}


/* News Section Styles */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    padding: 1rem;
    background: var(--ctf-light, #f8f9fa);
    border: 1px solid var(--ctf-border, #dee2e6);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.news-item:hover {
    border-color: var(--ctf-primary, #0d6efd);
    background: rgba(13, 110, 253, 0.03);
}

.news-item.pinned {
    border-left: 3px solid #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.news-item.pinned:hover {
    background: rgba(255, 193, 7, 0.08);
}

.news-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.news-date {
    font-size: 0.8rem;
    color: var(--ctf-gray, #6c757d);
    white-space: nowrap;
}

.news-content {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
    /* Limit content display and handle overflow */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

@media (max-width: 768px) {
    .news-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-date {
        order: -1;
    }
}
