/* Hacker Theme - Black & Green CTF Platform */
:root {
    --hacker-bg: #000000;
    --hacker-secondary-bg: #0d1117;
    --hacker-card-bg: #161b22;
    --hacker-green: #00ff00;
    --hacker-green-dark: #00cc00;
    --hacker-green-light: #39ff14;
    --hacker-text: #c9d1d9;
    --hacker-text-muted: #8b949e;
    --hacker-border: #21262d;
    --hacker-error: #ff4444;
    --hacker-warning: #ffcc00;
}

/* Body and Background */
.hacker-body {
    background: linear-gradient(135deg, var(--hacker-bg) 0%, var(--hacker-secondary-bg) 100%);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: var(--hacker-text);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Matrix-style background animation */
.hacker-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--hacker-green) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, var(--hacker-green) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.03;
    z-index: -1;
    animation: matrix-bg 20s linear infinite;
}

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

/* Custom Bootstrap Overrides */
.bg-dark {
    background-color: var(--hacker-card-bg) !important;
}

.text-success {
    color: var(--hacker-green) !important;
}

.text-danger {
    color: var(--hacker-error) !important;
}

.border-success {
    border-color: var(--hacker-green) !important;
}

/* Cards and Containers */
.hacker-card {
    background: var(--hacker-card-bg);
    border: 2px solid var(--hacker-green);
    border-radius: 10px;
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.1),
        inset 0 0 20px rgba(0, 255, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.hacker-card:hover {
    box-shadow: 
        0 0 30px rgba(0, 255, 0, 0.2),
        inset 0 0 30px rgba(0, 255, 0, 0.1);
    transform: translateY(-2px);
}

.hacker-card-header {
    background: linear-gradient(90deg, var(--hacker-green), var(--hacker-green-dark));
    color: var(--hacker-bg);
    font-weight: 600;
    text-align: center;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Forms */
.form-control {
    background-color: var(--hacker-secondary-bg);
    border: 1px solid var(--hacker-green);
    color: var(--hacker-text);
    font-family: 'JetBrains Mono', monospace;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: var(--hacker-card-bg);
    border-color: var(--hacker-green-light);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    color: var(--hacker-text);
}

.form-control::placeholder {
    color: var(--hacker-text-muted);
}

/* Buttons */
.btn-hacker {
    background: linear-gradient(45deg, var(--hacker-green), var(--hacker-green-dark));
    border: none;
    color: var(--hacker-bg);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 25px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
}

.btn-hacker:hover {
    background: linear-gradient(45deg, var(--hacker-green-light), var(--hacker-green));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    color: var(--hacker-bg);
}

.btn-hacker-danger {
    background: linear-gradient(45deg, var(--hacker-error), #cc0000);
    color: white;
}

.btn-hacker-danger:hover {
    background: linear-gradient(45deg, #ff6666, var(--hacker-error));
    color: white;
}

.btn-hacker-secondary {
    background: linear-gradient(45deg, var(--hacker-text-muted), #555);
    color: white;
}

.btn-hacker-secondary:hover {
    background: linear-gradient(45deg, #777, var(--hacker-text-muted));
    color: white;
}

/* Alerts and Messages */
.alert-hacker-success {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--hacker-green);
    color: var(--hacker-green);
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.alert-hacker-error {
    background: rgba(255, 68, 68, 0.15);
    border: 2px solid var(--hacker-error);
    color: var(--hacker-error);
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.alert-hacker-warning {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid var(--hacker-warning);
    color: var(--hacker-warning);
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

/* Terminal-style elements */
.terminal-output {
    background: var(--hacker-bg);
    border: 1px solid var(--hacker-green);
    border-radius: 5px;
    padding: 15px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--hacker-green);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-x: auto;
}

.terminal-prompt::before {
    content: '$ ';
    color: var(--hacker-green);
    font-weight: bold;
}

/* Loading Spinner */
.hacker-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--hacker-border);
    border-top: 4px solid var(--hacker-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Glitch Effect for Headings */
.glitch {
    position: relative;
    color: var(--hacker-green);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #ff0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, 1px);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, -1px);
    }
}

/* List styling */
.hacker-list {
    list-style: none;
    padding: 0;
}

.hacker-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--hacker-border);
    color: var(--hacker-text);
}

.hacker-list li:last-child {
    border-bottom: none;
}

.hacker-list li strong {
    color: var(--hacker-green);
}

/* Code styling */
code {
    background: var(--hacker-secondary-bg);
    color: var(--hacker-green);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid var(--hacker-border);
}

/* Navbar customization */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--hacker-green-light) !important;
}

/* Footer */
footer {
    background: var(--hacker-card-bg) !important;
    border-top: 2px solid var(--hacker-green) !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .hacker-card {
        margin: 10px;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Accordion styling for hacker theme */
.accordion {
    --bs-accordion-bg: var(--hacker-card-bg);
    --bs-accordion-border-color: var(--hacker-green);
    --bs-accordion-border-radius: 0.5rem;
}

.accordion-item {
    background-color: var(--hacker-card-bg);
    border: 1px solid var(--hacker-green);
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.accordion-button {
    background-color: var(--hacker-secondary-bg);
    color: var(--hacker-text);
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background-color: var(--hacker-green);
    color: var(--hacker-bg);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 255, 0, 0.25);
    border-color: var(--hacker-green);
}

.accordion-button:hover {
    background-color: rgba(0, 255, 0, 0.1);
    color: var(--hacker-green);
}

.accordion-button:not(.collapsed):hover {
    background-color: var(--hacker-green-light);
    color: var(--hacker-bg);
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2300ff00'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000000'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
}

.accordion-body {
    background-color: var(--hacker-card-bg);
    color: var(--hacker-text);
    border-top: 1px solid var(--hacker-green);
    padding: 1.25rem;
}

.accordion-collapse {
    border: none;
}

/* Hints container styling */
#hints-list {
    max-height: 300px; /* Approximately 4 hints */
    overflow-y: auto;
    padding-right: 8px; /* Space for scrollbar */
}

/* Custom scrollbar for hints */
#hints-list::-webkit-scrollbar {
    width: 8px;
}

#hints-list::-webkit-scrollbar-track {
    background: var(--hacker-secondary-bg);
    border-radius: 4px;
}

#hints-list::-webkit-scrollbar-thumb {
    background: var(--hacker-green);
    border-radius: 4px;
    transition: background 0.3s ease;
}

#hints-list::-webkit-scrollbar-thumb:hover {
    background: var(--hacker-green-light);
}

/* Firefox scrollbar */
#hints-list {
    scrollbar-width: thin;
    scrollbar-color: var(--hacker-green) var(--hacker-secondary-bg);
}

/* Animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hacker-card {
    animation: fadeInUp 0.6s ease-out;
}
