/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

/* Layout */
.container {
    display: flex;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

.editor-panel, .preview-panel {
    flex: 1;
    height: 100%;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Card Header */
.card-header {
    padding: 12px 20px;
    background-color: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Editor Styling */
.editor-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    padding: 16px;
}

#css-editor, #highlighting {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    border: none;
    outline: none;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#css-editor {
    position: absolute;
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    color: transparent;
    background: transparent;
    caret-color: #1e293b;
    resize: none;
    z-index: 2;
}

#highlighting {
    position: absolute;
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    z-index: 1;
    color: #334155;
}

/* Syntax Highlighting */
.token-key { color: #e11d48; font-weight: 600; }
.token-value { color: #0284c7; }
.token-punct { color: #64748b; }

/* Preview Styling */
.preview-panel {
    display: flex;
    flex-direction: column;
}

.preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
}

#preview-content {
    font-size: 2rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
