/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #1e1e1e;
    --secondary-bg: #252526;
    --header-bg: #333333;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --html-color: #e44d26;
    --css-color: #264de4;
    --js-color: #f7df1e;
    --border-radius: 8px;
    --spacing: 20px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Define color and spacing variables for consistency */
:root {
    --header-bg: #333; /* Dark background for the header */
    --link-color: #4e8ef7; /* Blue color for the link */
    --text-color: #fff; /* White text color for better contrast */
    --spacing: 20px; /* General spacing for padding */
}

/* Header Styles */
header {
    background-color: var(--header-bg);
    padding: var(--spacing);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); /* Subtle shadow effect */
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between; /* Spaces elements on the left and right */
    align-items: center;
    flex-wrap: wrap; /* Ensures elements wrap on smaller screens */
}

h1 {
    font-size: 2rem; /* Slightly larger font size for the header */
    font-weight: 700; /* Bolder font weight */
    color: var(--text-color); /* Ensure text color is white */
    text-align: left; /* Align text to the left */
    margin: 0;
    text-transform: uppercase; /* Adds a modern touch */
    letter-spacing: 1px; /* Spacing between letters */
    flex-grow: 1; /* Allows the title to grow and take available space */
}

a {
    font-size: 1rem; /* Set font size for the link */
    color: var(--link-color); /* Set link color */
    text-decoration: none; /* Remove underline */
    font-weight: 400;
    transition: color 0.3s ease; /* Smooth transition for hover effect */
}

a:hover {
    color: #ff7f50; /* Hover color to indicate interactivity */
}

/* Media query for responsiveness on smaller screens */
@media (max-width: 768px) {
    header {
        justify-content: center; /* Center content when on small screens */
        text-align: center;
    }

    h1 {
        font-size: 1.5rem; /* Adjust font size for smaller screens */
    }

    a {
        font-size: 0.9rem; /* Adjust link font size */
        margin-top: 10px; /* Add margin for spacing */
    }
}


/* Container Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing);
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

/* Editor Section */
.editor {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing);
    width: 100%;
}

.editor-card {
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.editor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Card Headers */
.card-header {
    padding: 12px var(--spacing);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.html-header { background-color: var(--html-color); }
.css-header { background-color: var(--css-color); }
.js-header { background-color: var(--js-color); }
.output-header { background-color: var(--header-bg); }

/* Editor TextArea */
.card-body {
    padding: var(--spacing);
}

.code-editor {
    width: 100%;
    min-height: 200px;
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: none;
    resize: vertical;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    transition: var(--transition);
}

.code-editor:focus {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Output Section */
.output-section {
    width: 100%;
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.output-frame {
    width: 100%;
    min-height: 500px;
    border: none;
    background-color: white;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .editor {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .code-editor {
        font-size: 13px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Previous CSS remains the same until the output section */

/* Output Section */
.output-section {
    width: 100%;
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.output-section.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    border-radius: 0;
    margin: 0;
    padding: 0;
}

.card-header {
    padding: 12px var(--spacing);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 50px; /* Fixed header height */
}

.output-section.fullscreen .card-body {
    height: calc(100vh - 50px); /* Subtract header height */
    padding: 0;
    margin: 0;
}

.output-frame {
    width: 100%;
    height: 500px; /* Default height */
    border: none;
    background-color: white;
    display: block;
}

.output-section.fullscreen .output-frame {
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
}

.fullscreen-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.fullscreen-btn .expand-icon,
.fullscreen-btn .collapse-icon {
    display: none;
    font-size: 20px;
}

.fullscreen-btn .expand-icon {
    display: block;
}

.output-section.fullscreen .fullscreen-btn .expand-icon {
    display: none;
}

.output-section.fullscreen .fullscreen-btn .collapse-icon {
    display: block;
}

/* Ensure no scrolling on body when fullscreen */
body.fullscreen-active {
    overflow: hidden;
}

/* Rest of the previous CSS remains the same */