/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* Aegean-inspired color palette - matching portfolio site */
    --color-primary: #1a5f7a;    /* Deep azure blue */
    --color-secondary: #e86d57;  /* Warm terra cotta */
    --color-background: #f5f1e8; /* Warm parchment */
    --color-text: #1d3557;      /* Deep navy text */
    --color-accent: #c49b3c;    /* Muted gold */
    --color-dark: #102a43;      /* Darker navy for contrast */
}

/* Base Styles */
body {
    background: var(--color-background);
    color: var(--color-text);
    font-family: 'Crimson Pro', Georgia, serif;
    line-height: 1.8;
    font-size: 1.4rem;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Analecta', Georgia, "Times New Roman", serif;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    font-weight: normal;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.8rem; }

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

/* Editor and Output Layout */
.editor-output-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
    width: 100%;  /* Use full width */
}

/* Output Display */
.output-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 600px;  /* Larger display area */
    display: flex;
    flex-direction: column;
    justify-content: center;
    order: -1;  /* Ensure output comes first */
}

.pattern-render {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pattern-render svg {
    max-width: 100%;
    max-height: 600px;  /* Larger pattern size */
    width: auto;
    height: auto;
}

/* Navigation Links */
.nav-links {
    text-align: right;
    margin: 1rem 0;
    font-size: 1.1rem;
}

.nav-links a {
    margin-left: 2rem;
}

/* Editor Controls */
.editor-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.editor-controls select {
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    background: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.download-select {
    margin-left: auto;  /* Push to right side */
}

/* Editor Container */
.editor-container {
    background: white;
    border: 1px solid var(--color-dark);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.code {
    flex-grow: 1;
    overflow: hidden;
}

.editor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    line-height: 1.5;
    color: #f5f1e8;
    height: 100%;
}

/* CodeMirror Specific Styles */
.CodeMirror {
    height: 100% !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.9rem !important;
    background: white !important;
}

/* Enhanced syntax highlighting - darker colors for white background */
.cm-s-dracula {
    background: white !important;
    color: #2a2a2a !important;
}

.cm-s-dracula .cm-keyword { 
    color: #0033cc !important;  /* Darker blue for keywords */
    font-weight: bold; 
}

.cm-s-dracula .cm-def { 
    color: #007a1f !important;  /* Darker green for definitions */
    font-weight: 500;
}

.cm-s-dracula .cm-atom { 
    color: #7a1f7a !important;  /* Dark purple for atoms/keywords */
}

.cm-s-dracula .cm-number { 
    color: #b34700 !important;  /* Dark orange for numbers */
}

.cm-s-dracula .cm-string { 
    color: #008066 !important;  /* Dark teal for strings */
}

.cm-s-dracula .cm-comment { 
    color: #737373 !important;  /* Medium gray for comments */
    font-style: italic; 
}

.cm-s-dracula .cm-bracket { 
    color: #4d4d4d !important;  /* Dark gray for brackets */
}

.cm-s-dracula .cm-builtin { 
    color: #cc0066 !important;  /* Dark pink for builtins */
    font-weight: 500;
}

.cm-s-dracula .cm-operator { 
    color: #b34700 !important;  /* Dark orange for operators */
}

.cm-s-dracula .cm-special { 
    color: #006699 !important;  /* Dark blue for special forms */
}

/* Matching brackets highlight */
.CodeMirror-matchingbracket {
    color: #007a1f !important;  /* Dark green */
    background: rgba(0, 122, 31, 0.1) !important;
    font-weight: bold !important;
}

/* Selection */
.cm-s-dracula ::selection { 
    background: rgba(0, 122, 31, 0.1) !important; 
}

.cm-s-dracula .CodeMirror-selected { 
    background: rgba(0, 122, 31, 0.1) !important; 
}

/* Active line */
.cm-s-dracula .CodeMirror-activeline-background {
    background: rgba(0, 0, 0, 0.03) !important;
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    justify-content: center;  /* Center the controls */
}

.editor-container .controls {
    margin-bottom: 1.5rem;  /* More space between controls and editor */
}

.button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    transition: all 0.3s ease;
}

.button:hover {
    background: var(--color-secondary);
    transform: scale(1.05);
}

/* Layout */
.body-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    body { font-size: 1.1rem; }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.6rem; }
    .body-container { padding: 1rem; }
}

@media (max-width: 800px) {
    body { font-size: 1rem; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }
    .controls { 
        flex-direction: column;
        align-items: stretch;
    }
    .button { width: 100%; }
    
    .editor-container,
    .output-container {
        min-height: 300px;  /* Slightly smaller on mobile */
        padding: 1rem;
    }
    
    .pattern-render svg {
        max-height: 300px;  /* Smaller patterns on mobile */
    }
} 