/* Main Stylesheet for CMD & PowerShell CTF Trainer */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --terminal-bg: #1e1e1e;
    --terminal-text: #00ff00;
    --terminal-header: #333;
}

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

/* Terminal Window Styling */
.terminal-window {
    background: var(--terminal-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.terminal-window.full-size {
    height: 500px;
}

.terminal-header {
    background: var(--terminal-header);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-button.close {
    background: #ff5f56;
}

.terminal-button.minimize {
    background: #ffbd2e;
}

.terminal-button.maximize {
    background: #27ca3f;
}

.terminal-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.terminal-body {
    padding: 15px;
    color: var(--terminal-text);
    font-family: 'Courier New', monospace;
    height: 400px;
    overflow-y: auto;
    background: var(--terminal-bg);
}

.terminal-line {
    margin-bottom: 5px;
    white-space: pre-wrap;
}

.terminal-output {
    color: #ccc;
    margin: 5px 0;
    white-space: pre-wrap;
}

.terminal-output.success {
    color: #27ca3f;
}

.terminal-input {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #2a2a2a;
    border-top: 1px solid #444;
}

.prompt {
    color: var(--terminal-text);
    margin-right: 8px;
    font-weight: bold;
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--terminal-text);
    font-family: 'Courier New', monospace;
    outline: none;
}

.command {
    color: #fff;
    font-weight: bold;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
}

/* Feature Cards */
.feature-card {
    transition: transform 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    color: var(--secondary-color);
}

/* Process Steps */
.process-steps {
    position: relative;
}

.process-step {
    display: flex;
    margin-bottom: 30px;
    position: relative;
}

.process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: -30px;
    width: 2px;
    background: var(--secondary-color);
    opacity: 0.3;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content h5 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

/* Code Comparison */
.code-comparison {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.comparison-tabs {
    display: flex;
    background: var(--light-color);
}

.tab-button {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
}

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

.tab-content pre {
    margin: 0;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

/* Challenge Cards */
.challenge-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.challenge-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.challenge-card.solved {
    border-color: var(--success-color);
}

.challenge-card.solved::before {
    content: '✓ SOLVED';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Stat Cards */
.stat-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Command List */
.command-list {
    max-height: 400px;
    overflow-y: auto;
}

.command-item {
    cursor: pointer;
    transition: background 0.3s ease;
}

.command-item:hover {
    background: #f8f9fa;
}

/* Progress Bars */
.progress {
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Learning Path */
.learning-path {
    position: relative;
}

.path-step {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.path-connector {
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--secondary-color);
    opacity: 0.3;
}

.path-step:last-child .path-connector {
    display: none;
}

/* Forms */
.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

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

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
}

.navbar-nav .nav-link {
    font-weight: 500;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .terminal-window.full-size {
        height: 300px;
    }
    
    .process-step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .process-step:not(:last-child)::after {
        left: 50%;
        top: 40px;
        bottom: -30px;
        transform: translateX(-50%);
    }
}

/* Print Styles */
@media print {
    .btn, .navbar, .card-header .btn {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .progress-bar {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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