:root {
    --primary-color: #bd93f9;
    --secondary-color: #ff79c6;
    --background-color: #282a36;
    --text-color: #f8f8f2;
    --border-color: rgba(255, 255, 255, 0.08);
    --hover-color: #caa9fa;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 95%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--primary-color);
    background-image: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 0.8rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

header .container {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
    overflow: hidden;
    height: calc(100vh - 140px);
    padding-bottom: 1rem;
}

.editor-container {
    background-color: #282a36;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background-color: rgba(52, 55, 70, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#analysis-status {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.8;
}

.editor-wrapper {
    position: relative;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0.5rem 0;
    background-color: #282a36;
}

.CodeMirror {
    height: 100% !important;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5 !important;
    padding: 1rem 0;
    background-color: #282a36 !important;
}

.CodeMirror-activeline-background {
    background: rgba(189, 147, 249, 0.08) !important;
}

.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
    padding: 0 8px;
}

.CodeMirror-lines {
    padding: 0;
}

.CodeMirror-line {
    padding-left: 4px !important;
}

.CodeMirror-selected {
    background: rgba(189, 147, 249, 0.15) !important;
}

.CodeMirror-selectedtext {
    color: #f8f8f2 !important;
}

.CodeMirror-focused .CodeMirror-selected {
    background: rgba(189, 147, 249, 0.2) !important;
}

.CodeMirror-gutters {
    border-right: none;
    background-color: rgba(40, 42, 54, 0.6);
    position: relative;
}

.CodeMirror-gutter-wrapper {
    display: flex;
    align-items: center;
    height: 20px;
    position: relative;
}

.CodeMirror-linenumber {
    color: rgba(248, 248, 242, 0.3);
    padding: 0 8px 0 4px !important;
    height: 20px;
    display: flex;
    align-items: center;
    position: relative;
    top: -1px;
}

.CodeMirror-sizer {
    margin-left: 60px !important;
}

.CodeMirror-scroll {
    margin-right: 0;
    margin-bottom: 0;
}

.complexity-widget {
    margin: 0 0.5em;
    text-decoration: none;
    border-radius: 3px;
    padding: 0.1em 0.4em;
    font-size: 0.9em;
    color: #FFFFFF;
    display: inline-block;
}

.low-complexity {
    background-color: rgba(61, 139, 64, 0.8);
}

.high-complexity {
    background-color: rgba(166, 51, 51, 0.8);
}

footer {
    padding: 1rem 0;
    text-align: center;
    background-color: rgba(40, 42, 54, 0.5);
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

footer .container {
    padding: 0 20px;
}

footer p {
    margin: 0;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #282a36;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 3px solid #282a36;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
