:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --btn-bg: #333333;
    --btn-hover: #555555;
    --btn-text: #ffffff;
    --font-size: 32px;
    --font-family: 'Inter', sans-serif;
    --toolbar-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    min-height: 100%;
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    /* Allow body scroll */
}

/* Toolbar Styling */
.toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--toolbar-height);
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 2px solid #333;
}

.button-group {
    display: flex;
    gap: 15px;
}

.btn {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 2px solid #555;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    touch-action: manipulation;
    /* Prevents double-tap to zoom on iPhones/iPads */
}

.btn:hover,
.btn:active {
    background-color: var(--btn-hover);
    transform: scale(0.98);
}

.btn-warning {
    background-color: #5a1010;
    border-color: #ff4444;
}

.btn-warning:hover,
.btn-warning:active {
    background-color: #ff4444;
}

.btn-primary {
    background-color: #004080;
    border-color: #0077cc;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: #0077cc;
}

.hidden {
    display: none !important;
}

/* Editor Styling */
.editor-container {
    min-height: calc(100vh - var(--toolbar-height));
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

textarea {
    width: 100%;
    flex-grow: 1;
    min-height: calc(100vh - var(--toolbar-height) - 40px);
    background-color: transparent;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: var(--font-size);
    font-weight: 700;
    border: none;
    outline: none;
    resize: none;
    line-height: 1.5;
    overflow-y: hidden;
    caret-color: #ffeb3b;
    /* High contrast yellow caret */
    /* We'll auto-resize it with JS so the body scrolls instead */
}

textarea::placeholder {
    color: #666666;
}

/* Responsive adjustments for smaller screens (though target is iPad) */
@media (max-width: 768px) {
    .toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
        gap: 10px;
        justify-content: center;
    }

    .btn {
        padding: 10px;
    }

    .btn-text {
        display: none;
        /* Hide text on very small screens, keep icons */
    }

    .editor-container {
        height: calc(100% - 60px);
        /* Adjust based on toolbar height */
    }
}

/* Print Styling */
@media print {

    *,
    *::before,
    *::after {
        background: transparent !important;
        background-color: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .no-print {
        display: none !important;
    }

    .editor-container {
        height: auto !important;
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }

    textarea {
        display: none !important;
    }

    .print-only {
        display: block !important;
        font-family: var(--font-family) !important;
        font-size: var(--font-size) !important;
        font-weight: 700 !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

.print-only {
    display: none;
}