/* 
 * HTML Syntax Highlighter & Formatter Styles
 * QuotedEncoder (2026)
 */

/* Layout & Panels */
.formatter-container {
    display: flex;
    height: calc(100vh - 120px); /* Adjusted for standardized header/footer height */
    background: #fdfdfd;
}

.formatter-panel {
    flex: 1;
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
}

.formatter-divider {
    width: 6px;
    background: #f1f5f9;
    cursor: ew-resize;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.formatter-divider:hover {
    background: #e2e8f0;
}

/* Panel Header & Toolbar */
.panel-header {
    background: #f8fafc;
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #475569;
}

.formatter-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    flex-wrap: wrap;
}

.formatter-toolbar input[type="text"] {
    font-size: 13px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 10px;
    background: #f8fafc;
    transition: all 0.2s;
}

.formatter-toolbar input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 210, 0.1);
}

.formatter-btn {
    background: #2563eb;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    padding: 6px 12px;
    font-size: 13px;
    transition: all 0.2s;
}

.formatter-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.formatter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.formatter-stats {
    font-size: 12px;
    color: #64748b;
    margin-right: 8px;
}

.match-count {
    font-size: 12px;
    color: #2563eb;
    font-weight: 600;
}

/* Code Area Styling (The IDE Feel) */
.code-area {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.code-overlay,
.code-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Fira Code', 'Fira Mono', monospace;
    padding: 20px;
    margin: 0;
    border: none;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-all;
    overflow: auto;
}

.code-overlay {
    pointer-events: none;
    background: transparent;
    z-index: 1;
}

.code-input {
    background: transparent;
    color: transparent;
    z-index: 2;
    caret-color: #2563eb;
    outline: none;
    resize: none;
}

.panel-output {
    background: #fcfcfd;
}

#output-html {
    margin: 0;
    font-size: 14px;
    font-family: 'Fira Code', 'Fira Mono', monospace;
    padding: 20px;
    background: #f8fafc;
    white-space: pre-wrap;
    overflow: auto;
    line-height: 1.6;
    height: 100%;
}

#rendered-output {
    flex: 1;
    border: none;
    display: none;
    background: white;
}

/* Mode Selectors */
.view-modes {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}

.view-modes button {
    border: none;
    background: transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.view-modes button.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Prism Color Overrides for "QuotedEncoder" brand */
.token.tag,
.token.tag .punctuation,
.token.attr-name {
    color: #8b1d1d; /* Elegant deep red */
}

.token.attr-value,
.token.string {
    color: #0c4a6e; /* Deep ocean blue */
}

.token.comment {
    color: #166534; /* Soft organic green */
}

.token.punctuation {
    color: #64748b;
}

/* Tool Header Integration */
.tool-header-info {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.tool-header-info span {
    font-weight: 700;
    color: #2563eb;
}

/* Responsive Overrides */
@media (max-width: 900px) {
    .formatter-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .formatter-panel {
        height: 450px;
    }
    .formatter-divider {
        width: 100%;
        height: 6px;
        cursor: ns-resize;
    }
}
