/* App styles. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

#sidebarContainer {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    position: relative;
    width: 100%;
    flex: 1;
}

#mainContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

#dropZone {
    flex: 1;
    border: 3px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
    user-select: none;
    box-sizing: border-box;
    margin: 0;
    padding: 20px;
}

#dropZone:hover {
    border-color: #007bff;
    background: #f9f9f9;
}

#dropZone.dragover {
    border-color: #007bff;
    background: #e3f2fd;
}

#dropZone.hidden {
    display: none;
}

.placeholder {
    text-align: center;
    color: #999;
    font-size: 18px;
    padding: 40px;
}

#content {
    display: none;
    flex: 1;
    font-family: var(--content-font, inherit);
    line-height: 1.6;
    background: white;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
}

#content.loaded {
    display: block;
}

/* Control panel */
#controlPanel {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none;
    gap: 10px;
    align-items: center;
    z-index: 1000;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.25;
    transition: opacity 0.3s ease;
}

#controlPanel.visible {
    display: flex;
}

/* File-specific controls stay hidden until a document is open. */
#controlPanel:not(.file-open) .file-only {
    display: none !important;
}

/* Opening another file is available from the drop zone before a document is open. */
#controlPanel.file-open #openFileBtn {
    display: none !important;
}

#controlPanel:hover {
    opacity: 1;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-item label {
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.control-item input[type="checkbox"] {
    cursor: pointer;
}

.control-item select {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

/* Reload button */
#reloadBtn {
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
    box-shadow: none;
}

#reloadBtn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

#reloadBtn:active {
    transform: scale(0.95);
}

#reloadBtn svg {
    width: 20px;
    height: 20px;
}

.toolbar-icon-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
    box-shadow: none;
}

.toolbar-icon-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.toolbar-icon-btn:active {
    transform: scale(0.95);
}

.toolbar-icon-btn svg {
    width: 20px;
    height: 20px;
}

#controlPanel [hidden] {
    display: none !important;
}

#fileInput {
    display: none;
}

.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 16px;
    background: #333;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-message.success {
    background: #28a745;
}

.status-message.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.status-message.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

#mainContent { min-width: 0; }
