/* Jankyard.ai - Intentionally Janky CSS */

:root {
    --bg-dark: #0d1117;
    --bg-darker: #010409;
    --bg-card: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --primary: #58a6ff;
    --success: #3fb950;
    --error: #f85149;
    --warning: #d29922;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: no-preference) {
    * {
        scroll-behavior: smooth;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

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

/* Navigation */
.navbar {
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.3));
    animation: float 3s ease-in-out infinite;
}

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

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

.nav-links li {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links .auth-link {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: transparent;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.nav-links .auth-link:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
}

#user-info .username {
    color: var(--success);
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: rgba(63, 185, 80, 0.1);
    border-radius: 4px;
    border: 1px solid var(--success);
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg-card) 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.hero-logo {
    max-width: 500px;
    width: 90%;
    height: auto;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 0 20px rgba(88, 166, 255, 0.4));
    animation: heroFloat 4s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-style: italic;
    font-weight: 600;
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
}

.description {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Sections */
.section {
    margin: 4rem 0;
    padding: 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .steps {
        grid-template-columns: 1fr;
    }
}

.step {
    text-align: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(88, 166, 255, 0.2);
}

.step-number {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, #79c0ff 100%);
    color: var(--bg-darker);
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.step h3 {
    margin-bottom: 0.75rem;
    color: var(--text);
    font-size: 1.3rem;
}

.step p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #79c0ff 100%);
    color: var(--bg-darker);
    border-color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: var(--bg-darker);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Code blocks */
pre {
    background-color: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #79c0ff;
}

pre code {
    color: var(--text);
}

/* Features list */
.features ul {
    list-style: none;
}

.features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

/* Challenge grid */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.challenge-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.challenge-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.challenge-card h2 {
    margin: 0 0 0.75rem 0;
    color: var(--primary);
    font-size: 1.4rem;
}

.challenge-description {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    flex: 1;
    line-height: 1.5;
    font-size: 0.95rem;
}

.challenge-meta {
    margin: 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.challenge-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

.challenge-actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
}

.form-group textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.radio-group {
    display: flex;
    gap: 2rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
}

/* Results */
.result-summary {
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.result-summary.success {
    background-color: rgba(63, 185, 80, 0.1);
    border: 1px solid var(--success);
}

.result-summary.failure {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--error);
}

.logs {
    margin-top: 2rem;
}

.log-entries {
    max-height: 500px;
    overflow-y: auto;
}

.log-entry {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.log-entry pre {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Leaderboard */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.leaderboard-table th {
    background-color: var(--bg-darker);
    font-weight: 600;
}

.leaderboard-table tr:hover {
    background-color: var(--bg-darker);
}

.leaderboard-table .rank-1 {
    background-color: rgba(255, 215, 0, 0.1);
}

.leaderboard-table .rank-2 {
    background-color: rgba(192, 192, 192, 0.1);
}

.leaderboard-table .rank-3 {
    background-color: rgba(205, 127, 50, 0.1);
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
}

footer p {
    margin: 0.3rem 0;
}

.coffee-support {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.coffee-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #FFDD00 0%, #FFA500 100%);
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 221, 0, 0.2);
    margin-top: 0.5rem;
}

.coffee-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 221, 0, 0.3);
    background: linear-gradient(135deg, #FFE333 0%, #FFB833 100%);
}

/* Error messages */
.error {
    color: var(--error);
    padding: 1rem;
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--error);
    border-radius: 6px;
    margin: 1rem 0;
}

.error-message {
    color: var(--error);
    margin: 1rem 0;
}

/* Info boxes */
.info-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.info-box h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 0.5rem 0;
}

/* Difficulty Tabs */
.difficulty-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0 1rem 0;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.difficulty-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.difficulty-tab:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.difficulty-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.difficulty-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .challenges-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar .container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 0.75rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
    
    .nav-links li {
        gap: 0.5rem;
    }
    
    .logo span {
        font-size: 1.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-logo {
        max-width: 90%;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.3rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .navbar {
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo-img {
        height: 32px;
    }
    
    .nav-links {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.6rem;
    }
    
    .auth-link {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.85rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.5rem;
    }
    
    .section {
        padding: 1.5rem;
    }
}
