/* Modern Design System */

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #10b981;
    --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

html {
    background-color: var(--bg-color);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Card layout */
.card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Navigation */
header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 3.75rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* Typography */
h1, h2, h3 {
    margin-top: 0;
    color: var(--text-color);
}

h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 1.5rem; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
textarea {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    font-family: 'Fira Code', monospace;
    resize: vertical;
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background-color: var(--primary-hover);
}

/* Inline form button */
.link-btn {
    background: none;
    color: var(--primary-color);
    border: none;
    padding: 0;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--primary-hover);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

th {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

tr:hover {
    background-color: #f8fafc;
}

/* Alerts */
.error {
    color: var(--error-color);
    background: #fef2f2;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #fee2e2;
    font-weight: 500;
}

.success {
    color: var(--success-color);
    background: #f0fdf4;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #dcfce7;
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 400; /* Normal font */
    color: var(--text-color);
    background-color: #f1f5f9;
}

/* Specific status colors */
.status-oczekiwanie { background-color: #f1f5f9; color: #475569; }
.status-kompilacja { background-color: #fef3c7; color: #92400e; }
.status-b\000142\000105d-kompilacji { background-color: #ffedd5; color: #9a3412; }
.status-testowanie { background-color: #e0f2fe; color: #075985; }
.status-b\000142\000105d-testowania { background-color: #fee2e2; color: #991b1b; }
.status-ok { background-color: #dcfce7; color: #166534; }

/* Clear button (X) */
.btn-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-x:hover {
    background-color: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

/* Custom File Upload */
.custom-file-upload {
    display: inline-block;
    padding: 0.5rem 1rem;
    cursor: pointer;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.custom-file-upload:hover {
    background-color: #e2e8f0;
    color: var(--text-color);
}

/* Code block */
.code-block {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.7;
}

.code-block code {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Expandable code block */
.code-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.code-block.collapsed {
    max-height: 1000px;
    overflow: hidden;
    position: relative;
}

.code-block.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(transparent, #1e293b);
    pointer-events: none;
}

.expand-btn {
    background-color: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-top: -0.5rem;
    width: 100%;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

.expand-btn:hover {
    background-color: #f1f5f9;
}

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Contest Timer */
.timer-container {
    height: 2.75rem; /* Reduced height */
    position: relative;
    border-top: 1px solid var(--border-color);
    background-color: #f1f5f9; /* Slightly different white */
    overflow: hidden;
}

.timer-text {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem; /* Smaller text for smaller bar */
    font-weight: 600;
    color: var(--text-color);
}

.progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border-radius: 0;
    overflow: hidden;
    z-index: 1;
}

.progress-bar {
    height: 100%;
    width: 0%;
    transition: width 0s linear;
}
