:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --error-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.formula-rain{
  content:"";
  position:fixed;
  inset:0;
  z-index:-3;
  background:
    url('data:image/svg+xml,\
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300">\
    <text x="10"  y="25" font-size="18" fill="%23ff00c133" font-family="monospace">∑CTF=∫Flag</text>\
    <text x="220" y="30" font-size="16" fill="%2300f2ff33" font-family="monospace">0x1337≡Hack</text>\
    <text x="120" y="55" font-size="14" fill="%23ff00c133" font-family="monospace">SHA256(k)=H</text>\
    <text x="300" y="50" font-size="17" fill="%2300f2ff33" font-family="monospace">RSA(n,e)</text>\
    <text x="50"  y="80" font-size="15" fill="%23ff00c133" font-family="monospace">a≡g^x(mod p)</text>\
    <text x="280" y="85" font-size="13" fill="%2300f2ff33" font-family="monospace">xor k ⊕ p</text>\
    <text x="150" y="110" font-size="16" fill="%23ff00c133" font-family="monospace">md5(m)=128b</text>\
    <text x="20"  y="135" font-size="14" fill="%2300f2ff33" font-family="monospace">LCG: xₙ₊₁≡(axₙ+c)%m</text>\
    <text x="240" y="140" font-size="18" fill="%23ff00c133" font-family="monospace">CTR→AES</text>\
    <text x="100" y="165" font-size="15" fill="%2300f2ff33" font-family="monospace">ECC:y²=x³+ax+b</text>\
    <text x="320" y="170" font-size="13" fill="%23ff00c133" font-family="monospace">dp→d%(p-1)</text>\
    <text x="60"  y="195" font-size="16" fill="%2300f2ff33" font-family="monospace">nonce⊕key=stream</text>\
    <text x="200" y="200" font-size="14" fill="%23ff00c133" font-family="monospace">H(k∥m)=tag</text>\
    </svg>');
  background-size:400px 300px;
  animation:formulaMove 30s linear infinite;
}
@keyframes formulaMove{
  from{background-position:0 0;}
  to{background-position:-400px 300px;}
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-3;
  background:
    radial-gradient(circle at 20% 30%, #ff00c166 0%, transparent 20%),
    radial-gradient(circle at 80% 70%, #00f2ff66 0%, transparent 20%);
  animation: pulse 8s ease-in-out infinite alternate;
}
@keyframes pulse{
  from{opacity:.15;}
  to{opacity:.35;}
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    margin-right: 120px;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from { box-shadow: 0 0 5px var(--prime); }
    to { box-shadow: 0 0 20px var(--prime), 0 0 30px var(--prime); }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    transition: 0.3s;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 2rem;
}

.validator-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    animation: slideInUp 0.8s ease-out;
}

.container-header {
    text-align: center;
    margin-bottom: 2rem;
}

.container-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.input-group-admins {
    display: grid;
    grid-template-columns:  2fr auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.select-wrapper,
.input-wrapper {
    position: relative;
}

.select-icon,
.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.question-select,
#userInput {
    width: 100%;
    max-width: 800px;
    padding: 1rem 3rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.question-select:focus,
#userInput:focus {
    outline: none;
    border-color: var(--prime);
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.2);
}

.validate-btn {
    padding: 1rem 1.5rem;
    width: fit-content;
    background: var(--success-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.3);
}

.result-container {
    margin-top: 1.5rem;
}

.success,
.error {
    padding: 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInUp 0.5s ease-out;
}

.success {
    background: var(--success-gradient);
    color: white;
}

.error {
    background: var(--error-gradient);
    color: white;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.quick-btn {
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 800px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.stat-card i {
    font-size: 2rem;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

.footer {
    background: rgba(13, 15, 24,.05);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 242, 255, 0.1);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-dim);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--prime);
}

.footer-gif {
    position: absolute;
    right: 130px;
    top: -120px;
    width: 120px;
    height: auto;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hash-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    margin-top: 1rem;
}

.problem-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.problem-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.difficulty-easy { border-left: 4px solid #4CAF50; }
.difficulty-medium { border-left: 4px solid #FF9800; }
.difficulty-hard { border-left: 4px solid #F44336; }

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

@media (max-width: 1010px) {
    :root {
        --base-fs: clamp(12px, 2.2vw, 14px);
    }
    html {
        font-size: var(--base-fs);
    }

    body {
        overflow-x: hidden;
        width: 100vw;
    }
    html, body { 
        height: auto; 
        overflow-y: auto; 
    }
    .navbar {
        padding: 0.5rem 0.75rem;
    }
    .site-title {
        font-size: 1.2rem; 
    }
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 100%;
        flex-direction: column;
        background: var(--bg-dark);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

  .validator-container,
  .problem-container {
    width: 96%;
    margin-top: 4.5rem; 
    padding: 1.5rem 1rem;
    border-radius: 12px;
  }
  .validator-container h1 {
    font-size: 1.25rem;
  }
  .subtitle {
    font-size: 0.9rem;
  }

  .input-group,
  .input-group-admins {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .question-select,
  #userInput {
    font-size: 1rem; 
    padding: 0.75rem 2.5rem 0.75rem 1rem;
  }
  .validate-btn {
    width: 100%;
    justify-content: center;
    padding: 0.9rem;
    font-size: 1rem;
  }

  .quick-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .quick-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .stats-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .stat-card {
    padding: 1rem;
  }
  .stat-number {
    font-size: 1.5rem;
  }

  .problem-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
  }
  .download-link {
    align-self: flex-end;
    margin-top: 0.25rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 1rem 0.5rem;
  }

  #particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
  }
  .problem-scroll-wrapper {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
    html, body { height: auto; overflow-y: auto; }
    .problem-scroll-wrapper { max-height: none; overflow: visible; }
}
@media (max-width: 1200px) { 
    .admin-mode-text {
        display: none !important;
    }

    .footer-gif {
        display: none;
    }
}


