/* TradingContest Pro - Shared Hosting CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile nav hidden by default */
.nav {
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.85); /* dark transparent */
    position: absolute;
    top: 60px; /* adjust depending on header height */
    right: 1rem;
    width: 220px;
    padding: 1rem;
    border-radius: 0.75rem;
    backdrop-filter: blur(6px); /* adds a frosted glass effect */
    z-index: 1000;
    animation: fadeIn 0.3s ease forwards;
}

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* When JS adds "open" */
.nav.open {
    display: flex;
}

/* Links inside nav */
.nav a {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    text-decoration: none;
    font-size: 1rem;
    color: #ffffff; /* white text */
    border-radius: 0.5rem;
    transition: background 0.2s, color 0.2s;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #60a5fa; /* light blue hover */
}

/* Buttons inside nav */
.nav .btn {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

/* Desktop: always visible */
@media (min-width: 768px) {
    .nav {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: none;
        backdrop-filter: none;
        box-shadow: none;
        width: auto;
        padding: 0;
    }

    .nav a {
        margin: 0 0.75rem;
        padding: 0;
        color: #1f2937; /* dark gray text on desktop */
    }

    .mobile-menu-toggle {
        display: none;
    }
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    flex-shrink: 0;
    font-family: 'Poppins', 'Segoe UI', sans-serif;

    /* Gradient text */
    background: linear-gradient(90deg, #000000, #FFA500, #008000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    /* Stylish glow for dark theme */
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 1px;

    /* Smooth effect */
    transition: transform 0.2s ease, text-shadow 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.8),
                 0 0 20px rgba(6, 182, 212, 0.6);
}


.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav a:hover {
    color: #2563eb;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f9fafb;
}

.btn-admin {
    padding: 0.5rem;
    background: transparent;
    color: #6b7280;
}

.btn-admin:hover {
    color: #2563eb;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    padding: 5rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-highlight {
    color: #93c5fd;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-visual {
    text-align: center;
}

.hero-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Statistics */
.stats {
    background: white;
    padding: 4rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
      justify-content: center; /* Horizontal center */
    align-items: center;     /* Vertical center (optional) */
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-contests { color: #2563eb; }
.stat-prizes { color: #059669; }
.stat-traders { color: #2563eb; }
.stat-funded { color: #059669; }

/* Search Filters */
.filters {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 2rem 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Contest Cards */
.contests-grid {
    display: grid;
    gap: 1.5rem;
}

.contest-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.contest-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.contest-content {
    padding: 2rem;
}

.contest-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.broker-logo {
    width: 4rem;
    height: 4rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    position: relative;
}

.verified-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #059669;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.contest-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.contest-broker {
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contest-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    display: inline-block;
    margin-bottom: 1rem;
}

.status-open { background: #059669; }
.status-starting { background: #eab308; }
.status-progress { background: #2563eb; }
.status-ended { background: #6b7280; }

.contest-description {
    color: #6b7280;
    margin-bottom: 1rem;
}

.contest-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.contest-requirements {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.contest-requirements strong {
    color: #374151;
}

.contest-actions {
    display: flex;
    gap: 1rem;
}

.btn-register {
    background: #2563eb;
    color: white;
    text-decoration: none;
}

.btn-register:hover {
    background: #1d4ed8;
}

.btn-register.disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Admin Panel */
.admin-section {
    background: white;
    padding: 3rem 0;
}

.admin-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-grid-full {
    grid-column: span 2;
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* Footer */
.footer {
    background: #111827;
    color: white;
    padding: 3rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.footer h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    margin-top: 2rem;
    color: #9ca3af;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

.mobile-menu-toggle:hover {
    color: #2563eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header {
        position: relative;
    }
    
    .header-content {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        display: none;
        z-index: 1000;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav a, .nav span {
        padding: 0.75rem 1rem;
        display: block;
        border-bottom: 1px solid #f3f4f6;
        margin: 0;
    }
    
    .nav a:last-child {
        border-bottom: none;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-card {
        padding: 1.5rem;
    }
    
    .stats {
        padding: 2rem 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1rem 0.5rem;
    }
    
    .stat-item h3 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-item p {
        font-size: 0.875rem;
    }
    
    .filters {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 0.5rem;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .contest-card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .contest-content {
        padding: 1rem;
    }
    
    .contest-header {
        align-items: flex-start;
        text-align: left;
        gap: 0.75rem;
    }
    
    .broker-logo {
        width: 3rem;
        height: 3rem;
        font-size: 0.75rem;
    }
    
    .contest-info h3 {
        font-size: 1.125rem;
        line-height: 1.3;
    }
    
    .contest-broker {
        font-size: 0.875rem;
    }
    
    .contest-description {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .contest-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .meta-item {
        font-size: 0.75rem;
    }
    
    .contest-requirements {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .contest-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .contest-actions .btn {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .admin-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-button {
        width: 100%;
        text-align: center;
        font-size: 0.875rem;
    }
    
    .admin-card {
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .table-container {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .footer {
        padding: 2rem 0;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .footer h4 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero {
        padding: 1.5rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.1;
    }
    
    .hero p {
        font-size: 0.9375rem;
        line-height: 1.4;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .stat-item {
        padding: 1.5rem 1rem;
        border-bottom: 1px solid #e5e7eb;
        text-align: center;
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
    
    .filters {
        padding: 0.75rem;
    }
    
    .contest-content {
        padding: 0.75rem;
    }
    
    .contest-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }
    
    .broker-logo {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.625rem;
    }
    
    .contest-info {
        width: 100%;
    }
    
    .contest-info h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .contest-broker {
        font-size: 0.8125rem;
    }
    
    .contest-meta {
        justify-content: center;
        text-align: center;
    }
    
    .meta-item {
        font-size: 0.6875rem;
    }
    
    .contest-requirements {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }
    
    .admin-card {
        padding: 0.75rem;
    }
    
    .form-grid {
        gap: 0.75rem;
    }
    
    .form-control {
        padding: 0.625rem;
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .footer h4 {
        margin-bottom: 0.75rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
}


/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none; }
.success { color: #059669; }
.error { color: #dc2626; }
.loading { opacity: 0.6; pointer-events: none; }