/* Text Editor App Styles - GNOME gedit Style */

.text-editor-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e1e;
    color: #e0e0e0;
    font-family: 'Ubuntu', sans-serif;
}

/* Menu Bar */
.te-menubar {
    display: flex;
    background: #2d2d2d;
    border-bottom: 1px solid #1a1a1a;
    font-size: 13px;
}

.te-menu-item {
    position: relative;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.te-menu-item:hover,
.te-menu-item.open {
    background: rgba(255, 255, 255, 0.1);
}

.te-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #3d3d3d;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 100;
    padding: 4px 0;
}

.te-menu-item.open .te-dropdown {
    display: block;
}

.te-dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.1s;
}

.te-dropdown-item:hover {
    background: rgba(233, 84, 32, 0.4);
}

.te-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 12px;
}

.te-shortcut {
    margin-left: auto;
    padding-left: 24px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.te-toggle .te-check {
    width: 20px;
    margin-right: 8px;
    text-align: center;
    color: #26a269;
}

/* Toolbar */
.te-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: #353535;
    border-bottom: 1px solid #1a1a1a;
}

.te-tool-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.te-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.te-tool-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

.te-toolbar-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.te-toolbar-spacer {
    flex: 1;
}

.te-zoom-level {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 40px;
    text-align: center;
}

/* Find Bar */
.te-findbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #1a1a1a;
}

.te-findbar.hidden {
    display: none;
}

.te-find-row,
.te-replace-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.te-find-input,
.te-replace-input {
    flex: 1;
    max-width: 300px;
    padding: 6px 12px;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    font-size: 13px;
    outline: none;
}

.te-find-input:focus,
.te-replace-input:focus {
    border-color: #E95420;
}

.te-find-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    min-width: 70px;
}

.te-find-btn,
.te-replace-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}

.te-find-btn:hover,
.te-replace-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.te-find-close {
    margin-left: auto;
}

.te-replace-row.hidden {
    display: none;
}

/* Editor Container */
.te-editor-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Line Numbers */
.te-line-numbers {
    width: 50px;
    padding: 12px 8px;
    background: #252525;
    border-right: 1px solid #333;
    overflow: hidden;
    text-align: right;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
    user-select: none;
}

.te-line-numbers.hidden {
    display: none;
}

.te-line-num {
    height: 21px;
}

/* Textarea */
.te-textarea {
    flex: 1;
    padding: 12px;
    background: #1e1e1e;
    border: none;
    resize: none;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
    outline: none;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    tab-size: 4;
}

.te-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.te-textarea::selection {
    background: rgba(233, 84, 32, 0.4);
}

/* Minimap */
.te-minimap {
    width: 100px;
    background: #252525;
    border-left: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.te-minimap.hidden {
    display: none;
}

.te-minimap-content {
    font-size: 2px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.3);
    padding: 4px;
    white-space: pre;
    pointer-events: none;
}

.te-minimap-viewport {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(233, 84, 32, 0.2);
    border: 1px solid rgba(233, 84, 32, 0.4);
}

/* Status Bar */
.te-statusbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 12px;
    background: #2d2d2d;
    border-top: 1px solid #1a1a1a;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.te-status-spacer {
    flex: 1;
}

.te-status-selection {
    color: rgba(255, 255, 255, 0.5);
}

/* Dialogs */
.te-dialog {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.te-dialog.hidden {
    display: none;
}

.te-dialog-content {
    background: #3d3d3d;
    border-radius: 12px;
    padding: 24px;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.te-dialog-content h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 500;
}

.te-dialog-content input {
    width: 100%;
    padding: 10px 14px;
    background: #1e1e1e;
    border: 1px solid #555;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    outline: none;
    margin-bottom: 20px;
}

.te-dialog-content input:focus {
    border-color: #E95420;
}

.te-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.te-dialog-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.te-dialog-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.te-dialog-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.te-dialog-btn.primary {
    background: #E95420;
    color: white;
}

.te-dialog-btn.primary:hover {
    background: #ff6b3d;
}

/* About Dialog */
.te-about-content {
    text-align: center;
    min-width: 280px;
}

.te-about-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.te-about-content h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 500;
}

.te-about-version {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.te-about-desc {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.te-about-copy {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-bottom: 20px;
}

/* Shortcuts Dialog */
.te-shortcuts-content {
    min-width: 400px;
}

.te-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.te-shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.te-shortcut-item kbd {
    background: #1e1e1e;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 12px;
    border: 1px solid #444;
    min-width: 70px;
    text-align: center;
}

.te-shortcut-item span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* Scrollbar */
.te-textarea::-webkit-scrollbar,
.te-line-numbers::-webkit-scrollbar {
    width: 10px;
}

.te-textarea::-webkit-scrollbar-track,
.te-line-numbers::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.te-textarea::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

.te-textarea::-webkit-scrollbar-thumb:hover {
    background: #555;
}
