/* Windows XP Word Window */

/* Modal Overlay */
.word-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wordFadeIn 0.2s ease-out;
}

.word-modal-overlay.closing {
    animation: wordFadeOut 0.2s ease-out;
}

@keyframes wordFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wordFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Word Window */
.word-window {
    max-width: 1200px;
    width: 95vw;
    height: 90vh;
    background: #ECE9D8;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    border: 1px solid #0054E3;
    animation: wordSlideIn 0.3s ease-out;
}

@keyframes wordSlideIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Title Bar */
.word-titlebar {
    background: linear-gradient(180deg, #0054E3 0%, #3C8CFF 50%, #0054E3 100%);
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: move;
}

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

.word-icon {
    width: 16px;
    height: 16px;
}

.word-controls {
    display: flex;
    gap: 2px;
}

.word-btn {
    width: 21px;
    height: 19px;
    background: linear-gradient(180deg, #BCD4F6 0%, #89A9D7 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    color: #003;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.word-btn:hover {
    background: linear-gradient(180deg, #D6E8FF 0%, #A7C2E8 100%);
}

.word-btn:active {
    background: linear-gradient(180deg, #7A9FC7 0%, #BCD4F6 100%);
}

.word-close {
    background: linear-gradient(180deg, #F78383 0%, #E35454 100%);
    color: white;
}

.word-close:hover {
    background: linear-gradient(180deg, #FF9B9B 0%, #F66B6B 100%);
}

/* Menu Bar */
.word-menubar {
    background: #ECE9D8;
    padding: 2px 4px;
    display: flex;
    gap: 5px;
    font-size: 11px;
    border-bottom: 1px solid #ACA899;
}

.word-menu-item {
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 2px;
    user-select: none;
}

.word-menu-item:hover {
    background: #B6BDD2;
}

.word-menu-item:active {
    background: #8B92B9;
    color: white;
}

/* Toolbar */
.word-toolbar {
    background: #ECE9D8;
    padding: 4px;
    border-bottom: 1px solid #ACA899;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.word-toolbar-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.word-tool-btn {
    width: 24px;
    height: 22px;
    background: #ECE9D8;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
}

.word-tool-btn:hover {
    background: #FFFBF0;
    border: 1px solid #8B92B9;
}

.word-tool-btn:active {
    background: #D6E8FF;
    border: 1px solid #0054E3;
}

.word-separator {
    width: 1px;
    height: 20px;
    background: #ACA899;
    margin: 0 2px;
}

.word-font-select,
.word-size-select {
    background: white;
    border: 1px solid #ACA899;
    padding: 2px 4px;
    font-size: 11px;
    font-family: 'Times New Roman', serif;
    cursor: pointer;
}

.word-font-select {
    width: 140px;
}

.word-size-select {
    width: 50px;
}

/* Document Area */
.word-document {
    flex: 1;
    background: #C6C6C6;
    overflow-y: auto;
    padding: 20px;
    overflow-x: hidden;
}

.word-page {
    background: white;
    width: 816px; /* 8.5 inches at 96 DPI */
    min-height: 1056px; /* 11 inches at 96 DPI */
    margin: 0 auto;
    padding: 96px; /* 1 inch margins */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.word-document-content {
    font-family: 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    position: relative;
}

/* Typing Cursor */
.word-cursor {
    animation: wordBlink 1s step-end infinite;
    color: #000;
    font-weight: normal;
}

@keyframes wordBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Status Bar */
.word-statusbar {
    background: #ECE9D8;
    padding: 4px 8px;
    font-size: 11px;
    display: flex;
    gap: 20px;
    border-top: 1px solid #ACA899;
    color: #000;
}

.word-status-page,
.word-status-pos,
.word-status-words {
    padding: 2px 4px;
}

/* Dialogs */
.word-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-dialog {
    background: #ECE9D8;
    border: 2px solid #0054E3;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}

.word-dialog-titlebar {
    background: linear-gradient(180deg, #0054E3 0%, #3C8CFF 50%, #0054E3 100%);
    padding: 4px 6px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-dialog-titlebar button {
    background: linear-gradient(180deg, #F78383 0%, #E35454 100%);
    border: none;
    color: white;
    width: 18px;
    height: 16px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 2px;
}

.word-dialog-content {
    padding: 15px;
}

.word-dialog-btn {
    background: #ECE9D8;
    border: 1px solid #ACA899;
    padding: 6px 16px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 2px;
    margin: 2px;
    display: block;
    width: 100%;
}

.word-dialog-btn:hover {
    background: #FFFBF0;
    border: 1px solid #0054E3;
}

.word-dialog-btn:active {
    background: #D6E8FF;
}

/* Clippy */
.word-clippy {
    position: fixed;
    bottom: 80px;
    right: 40px;
    z-index: 10002;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: clippyBounce 0.5s ease-out;
}

@keyframes clippyBounce {
    0% { transform: translateY(100px); opacity: 0; }
    60% { transform: translateY(-10px); }
    100% { transform: translateY(0); opacity: 1; }
}

.word-clippy-character {
    font-size: 80px;
    animation: clippyWiggle 2s ease-in-out infinite;
}

@keyframes clippyWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.word-clippy-bubble {
    background: #FFFBF0;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 250px;
    position: relative;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.word-clippy-bubble::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #000;
}

.word-clippy-bubble::before {
    content: '';
    position: absolute;
    bottom: 22px;
    left: -6px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #FFFBF0;
    z-index: 1;
}

.word-clippy-bubble button {
    background: #ECE9D8;
    border: 1px solid #000;
    padding: 4px 12px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 11px;
}

.word-clippy-bubble button:hover {
    background: #D6E8FF;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .word-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
    }

    .word-page {
        width: 100%;
        padding: 40px 20px;
    }

    .word-toolbar-row:nth-child(2) {
        display: none;
    }

    .word-clippy {
        bottom: 20px;
        right: 20px;
    }

    .word-clippy-character {
        font-size: 50px;
    }
}

/* Print Styles */
@media print {
    .word-modal-overlay {
        display: block;
        background: white;
        position: static;
    }

    .word-window {
        width: 100%;
        height: auto;
        max-width: 100%;
        box-shadow: none;
        border: none;
    }

    .word-titlebar,
    .word-menubar,
    .word-toolbar,
    .word-statusbar {
        display: none;
    }

    .word-document {
        background: white;
        padding: 0;
    }

    .word-page {
        box-shadow: none;
        margin: 0;
        width: 100%;
    }

    .word-cursor {
        display: none;
    }
}
