/**
 * WordCraft Web - Office 365 Theme & Core Layout Variables
 * License: MIT
 */

:root {
    --word-blue: #1473e6;
    --word-blue-hover: #0d66d0;
    --word-blue-active: #0952a8;
    --word-accent: #1473e6;
    --word-bg: #f8fafc;
    --word-canvas-bg: #eef2f6;
    --word-page-bg: #ffffff;
    --word-page-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
    --word-text: #0f172a;
    --word-text-muted: #475569;
    --word-border: #e2e8f0;
    --word-border-dark: #cbd5e1;
    --word-ribbon-bg: #ffffff;
    --word-ribbon-tab-active: #ffffff;
    --word-ribbon-hover: #f1f5f9;
    --word-ribbon-active: #e2e8f0;
    --word-status-bg: #f8fafc;
    --word-status-text: #334155;
    --word-ruler-bg: #f8fafc;
    --word-ruler-border: #cbd5e1;
    --word-selection: rgba(20, 115, 230, 0.22);
    --word-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.dark-mode {
    --word-bg: #1e1e1e;
    --word-canvas-bg: #181818;
    --word-page-bg: #2d2d2d;
    --word-page-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    --word-text: #f3f3f3;
    --word-text-muted: #a6a6a6;
    --word-border: #383838;
    --word-border-dark: #4a4a4a;
    --word-ribbon-bg: #252525;
    --word-ribbon-hover: #333333;
    --word-ribbon-active: #3c3c3c;
    --word-status-bg: #1e1e1e;
    --word-status-text: #cccccc;
    --word-ruler-bg: #252525;
    --word-ruler-border: #383838;
    --word-selection: rgba(96, 165, 250, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--word-font-family);
    font-size: 13px;
    color: var(--word-text);
    background-color: var(--word-bg);
}

#wordcraft_app {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* App Header & Title Bar */
.word-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    background-color: #f8fafc;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 10px;
    flex-shrink: 0;
    z-index: 100;
}

.word-title-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-app-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.2px;
    color: #0f172a;
}

.word-app-logo svg {
    width: 22px;
    height: 22px;
    color: #1473e6;
}

.word-quick-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 12px;
}

.word-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #334155;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.word-tool-btn:hover {
    background-color: #e2e8f0;
}

.word-tool-btn:active {
    background-color: #cbd5e1;
}

.word-tool-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.word-title-center {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
}

.word-doc-title {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.word-doc-title:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.word-search-box {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 4px 12px;
    flex: 1;
    height: 26px;
    color: #0f172a;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.word-search-box:focus-within {
    background-color: #ffffff;
    border-color: #1473e6;
    box-shadow: 0 0 0 2px rgba(20, 115, 230, 0.15);
    color: #0f172a;
}

.word-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-size: 12px;
    width: 100%;
    margin-left: 6px;
}

.word-search-box input::placeholder {
    color: #64748b;
}

.word-search-box:focus-within input::placeholder {
    color: #888888;
}

.word-title-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.word-header-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid transparent;
    color: #334155;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.word-header-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}
