/* 
 * UI Framework CSS - NOT REQUIRED FOR SOLVING CHALLENGES
 * This file contains only styling and UI elements
 * All challenge-critical CSS remains inline in HTML files
 */

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

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Layout */
.container {
    max-width: 800px;
    padding: 20px;
    text-align: center;
}

/* Typography */
h1 {
    color: #00ff00;
    margin-bottom: 10px;
    font-size: 2.5em;
}

h2 {
    color: #888;
    margin-bottom: 30px;
    font-size: 1.5em;
}

h3 {
    color: #ffcc00;
    margin-bottom: 10px;
}

/* Box Components */
.welcome-box p a {
    color: #00ff00;
}

.challenge-box, .info-box, .hint-box, .success-box, .interactive-box, .welcome-box, .error-box {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.challenge-box {
    border: 2px solid #00ff00;
}

.info-box {
    border: 2px solid #00ccff;
}

.hint-box {
    border: 2px solid #ffcc00;
}

.success-box {
    border: 2px solid #ff00ff;
}

.interactive-box {
    border: 2px solid #ff00ff;
}

.welcome-box {
    border: 2px solid #00ff00;
    padding: 40px;
}

.error-box {
    border: 2px solid #ff0000;
    padding: 40px;
}

.error-box h1 {
    color: #ff0000;
}

/* Text Styling */
.challenge-box p, .info-box p, .hint-box p, .success-box p, .interactive-box p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.info-box ul {
    list-style-position: inside;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.info-box li {
    margin-bottom: 10px;
}

code {
    background-color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    color: #00ff00;
}

/* Navigation */
.navigation {
    margin-top: 40px;
}

.next-button, .prev-button, .home-button {
    display: inline-block;
    background-color: #00ff00;
    color: #1a1a1a;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
    margin: 0 10px;
}

.prev-button {
    background-color: #888;
}

.home-button {
    background-color: #00ccff;
}

.next-button:hover {
    background-color: #00cc00;
}

.prev-button:hover {
    background-color: #666;
}

.home-button:hover {
    background-color: #0099cc;
}

/* Buttons */
button {
    background-color: #ff00ff;
    color: #1a1a1a;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

button:hover {
    background-color: #cc00cc;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

/* Hint Toggle */
.hint-toggle {
    background-color: #ffcc00;
    color: #1a1a1a;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.hint-toggle:hover {
    background-color: #ff9900;
}

.hint-content {
    display: none;
    animation: slideDown 0.3s ease-out;
}

.hint-content.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flag Related UI */
.flag-box {
    background-color: #1a1a1a;
    border: 3px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
}

.flag {
    font-size: 1.5em;
    font-family: monospace;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.flag-input-container {
    background-color: #2a2a2a;
    border: 2px solid #00ccff;
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
}

.flag-input {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    font-size: 1.1em;
    background-color: #1a1a1a;
    border: 2px solid #00ccff;
    color: #e0e0e0;
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
}

.flag-input:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.submit-flag {
    background-color: #00ccff;
    color: #1a1a1a;
}

.submit-flag:hover {
    background-color: #0099cc;
}

.flag-feedback {
    margin-top: 15px;
    font-size: 1.1em;
    font-weight: bold;
}

.flag-feedback.success {
    color: #00ff00;
}

.flag-feedback.error {
    color: #ff4444;
}

/* Homepage Specific */
.challenges-list {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.challenge-card {
    background-color: #2a2a2a;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    transition: all 0.3s;
}

.challenge-card:hover {
    border-color: #00ff00;
    transform: translateY(-2px);
}

.challenge-card h3 {
    margin-bottom: 10px;
}

.challenge-card a {
    color: #00ff00;
    text-decoration: none;
    font-weight: bold;
}

.difficulty {
    color: #ffcc00;
    font-size: 0.9em;
}

/* Progress UI */
.progress-container {
    background-color: #2a2a2a;
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.progress-text {
    font-size: 1.2em;
    color: #00ff00;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    transition: width 0.5s ease-out;
}

.reset-button {
    background-color: #ff4444;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 20px;
}

.reset-button:hover {
    background-color: #cc0000;
    transform: scale(1.05);
}

/* Completed Challenge Animation */
.challenge-card.completed {
    background: linear-gradient(45deg, #2a2a2a, #1a3a1a);
    border-color: #00ff00;
    position: relative;
    overflow: hidden;
}

.challenge-card.completed::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2em;
    color: #00ff00;
    animation: checkmarkPop 0.5s ease-out;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.challenge-card.completed::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.challenge-card.with-completed-img {
    display: block;
}

.challenge-card-content {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    margin-top: 10px;
}

.challenge-card-left {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
}

.challenge-card-img {
    flex: 0 0 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-left: 8px;
    margin-top: 0;
}

.challenge-card .completed-img {
    max-width: 64px;
    max-height: 64px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    background: #fff;
    transition: opacity 0.4s;
    opacity: 0.95;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.2em;
    }
    
    .container {
        padding: 10px;
    }
    
    .challenge-box, .info-box, .hint-box {
        padding: 20px;
    }
    
    .challenge-card-content {
        flex-direction: column;
        gap: 8px;
    }
    .challenge-card-img {
        margin-left: 0;
        align-items: flex-start;
    }
}