/* Custom Styles for CodeCraft Platform */

:root {
    --primary: #0D6EFD;
    --secondary: #6C757D;
    --success: #198754;
    --info: #0DCAF0;
    --warning: #FFC107;
    --danger: #DC3545;
    --light: #F8F9FA;
    --dark: #212529;
    --teal: #20C997;
    --purple: #6F42C1;
}

/* Global Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

main {
    flex: 1;
}

/* Navbar Brand Animation */
.navbar-brand {
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Cards */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Problem List */
.problem-card {
    margin-bottom: 16px;
}

.problem-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.problem-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tag-badge {
    margin-right: 4px;
    font-size: 0.75rem;
}

/* Code Editor */
.code-editor-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.CodeMirror {
    height: 400px;
    font-family: 'Source Code Pro', monospace;
    font-size: 14px;
}

.editor-header {
    background-color: #f8f9fa;
    padding: 8px 16px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-switch {
    cursor: pointer;
}

/* Language Selector */
.language-selector {
    padding: 8px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Test Cases */
.test-case {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.test-case-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--dark);
}

.test-case pre {
    background-color: #fff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-bottom: 8px;
}

/* Dashboard Stats */
.stat-card {
    text-align: center;
    padding: 24px 16px;
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--primary);
}

.stat-card h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

/* Submission Result */
.result-card {
    margin-top: 24px;
    border-left: 4px solid;
}

.result-card.success {
    border-left-color: var(--success);
}

.result-card.error {
    border-left-color: var(--danger);
}

.result-card.warning {
    border-left-color: var(--warning);
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Admin Forms */
.admin-form label {
    font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .problem-card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .problem-info {
        margin-top: 8px;
    }
    
    .CodeMirror {
        height: 300px;
    }
}

/* Leaderboard */
.leaderboard-table td {
    vertical-align: middle;
}

.user-rank {
    font-size: 1.2rem;
    font-weight: bold;
}

.rank-1 {
    color: gold;
}

.rank-2 {
    color: silver;
}

.rank-3 {
    color: #cd7f32; /* bronze */
}

/* Custom Badge Colors */
.badge-teal {
    background-color: var(--teal);
    color: white;
}

.badge-purple {
    background-color: var(--purple);
    color: white;
}

/* Profile */
.profile-header {
    padding: 32px 0;
    background-color: #f8f9fa;
    margin-bottom: 24px;
    border-radius: 8px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 24px;
}

.profile-stats .stat {
    flex: 1;
}

.profile-stats .stat h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

/* Dark Mode Toggle */
.theme-toggle {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(30deg);
}

/* Footer */
footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--info) !important;
    text-decoration: underline;
}