/* assets/css/style.css - Complete file with original design + EMI Calculator dropdown colors */

/* Global Color System (original) */
.free-notepad-container.word-like {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    border: 1px solid #0e7e94;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}

.notepad-heading {
    background: #f1f5f9;
    padding: 10px 16px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #0e7e94;
    text-align: center;
}

.global-toolbar {
    background: #f8fafc;
    padding: 6px 10px;
    border-bottom: 1px solid #0e7e94;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
}
.toolbar-input {
    background: white;
    border: 1px solid #0e7e94;
    border-radius: 3px;
    padding: 3px 4px;
    font-size: 12px;
    height: 26px;
    width: 70px;
}
.toolbar-input:focus {
    outline: none;
    border-color: #0b6b7d;
}

/* Tab Bar - Enhanced visibility for inactive tabs */
.tab-bar {
    background: #f1f5f9;
    padding: 4px 10px 0 10px;
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #0e7e94;
}
.tab-button {
    background: #e9eef3;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #1f2937;
    transition: all 0.2s ease;
    margin-right: 2px;
}
.tab-button:hover {
    background: #0e7e94;
    border-color: #0e7e94;
    color: white;
}
.tab-button.active {
    background: white;
    border-color: #0e7e94;
    border-bottom-color: white;
    color: #111827;
    font-weight: 600;
    margin-bottom: -1px;
}

.toolbar.tab-tools {
    background: #ffffff;
    padding: 6px 10px;
    border-bottom: 1px solid #0e7e94;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
}
.toolbar-btn, .toolbar-color {
    background: white;
    border: 1px solid #0e7e94;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 12px;
    cursor: pointer;
    color: #111827;
    height: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.toolbar-color {
    width: 24px;
    padding: 2px;
}
.toolbar-btn .material-icons {
    font-size: 18px;
}
.toolbar-btn:hover, .toolbar-color:hover {
    background: #0b6b7d !important;
    border-color: #0b6b7d;
    color: white;
}
.toolbar-btn.active {
    border-bottom: 2px solid #16a34a;
    background: #e0f0e0;
}

/* ============================================ */
/* DROPDOWN (SELECT) STYLES – MATCH EMI CALCULATOR */
/* Only colors changed, original layout preserved */
/* ============================================ */
.toolbar-select {
    background-color: #ffffff !important;
    border: 1px solid #dbe4ea !important;
    border-radius: 3px;  /* keep original border-radius */
    padding: 2px 4px;
    font-size: 12px;
    cursor: pointer;
    color: #374151 !important;
    height: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    width: auto;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 4px center !important;
    background-size: 12px !important;
}

.toolbar-select:hover {
    border-color: #0e7e94 !important;
}

.toolbar-select:focus {
    border-color: #0a6475 !important;
    box-shadow: 0 0 0 2px rgba(14,126,148,0.1) !important;
    outline: none !important;
}

/* Dropdown options */
.toolbar-select option {
    background-color: #ffffff !important;
    color: #111827 !important;
}
.toolbar-select option:hover,
.toolbar-select option:checked {
    background-color: #e8f2f4 !important;
    color: #0e7e94 !important;
}

/* Also apply to any other select inside notepad (page layout, etc.) */
.free-notepad-container select:not(.toolbar-select) {
    background-color: #ffffff !important;
    border: 1px solid #dbe4ea !important;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 12px;
    color: #374151 !important;
    height: 26px;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 4px center !important;
    background-size: 12px !important;
}
.free-notepad-container select:not(.toolbar-select):hover {
    border-color: #0e7e94 !important;
}
.free-notepad-container select:not(.toolbar-select):focus {
    border-color: #0a6475 !important;
    box-shadow: 0 0 0 2px rgba(14,126,148,0.1) !important;
    outline: none !important;
}
.free-notepad-container select:not(.toolbar-select) option {
    background-color: #ffffff !important;
    color: #111827 !important;
}
.free-notepad-container select:not(.toolbar-select) option:hover,
.free-notepad-container select:not(.toolbar-select) option:checked {
    background-color: #e8f2f4 !important;
    color: #0e7e94 !important;
}

/* ============================================ */
/* END DROPDOWN COLOR FIX – rest is original */
/* ============================================ */

.history-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.history-title {
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
}
.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.history-item {
    padding: 6px 10px;
    background: white;
    border: 1px solid #0e7e94;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}
.history-item:hover {
    background: #f1f5f9;
    border-color: #0b6b7d;
}
.history-item small {
    display: block;
    font-size: 10px;
    color: #6b7280;
}

.find-replace-panel {
    background: #f1f5f9;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #0e7e94;
}
.find-input, .replace-input {
    padding: 4px 6px;
    border: 1px solid #0e7e94;
    border-radius: 3px;
    min-width: 150px;
    font-size: 12px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #0e7e94;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}
.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover {
    color: #0e7e94;
}
.icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}
.icon-item {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #0e7e94;
    border-radius: 3px;
    cursor: pointer;
    background: white;
    font-family: 'Segoe UI', Arial, sans-serif;
}
.icon-item:hover {
    background: #0b6b7d;
    color: white;
    border-color: #0b6b7d;
}

.main-area.two-column {
    display: flex;
    min-height: 400px;
    background: white;
}
.line-numbers {
    width: 40px;
    padding: 10px 3px;
    background: #f1f5f9;
    border-right: 1px solid #0e7e94;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
    user-select: none;
    white-space: pre;
    overflow-y: hidden;
}
.notepad-editor {
    flex: 1;
    padding: 10px;
    border: none;
    resize: none;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    overflow-y: auto;
    background: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.notepad-editor[placeholder]:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    font-style: italic;
}

.status-bar {
    background: #0b1120;
    padding: 5px 12px;
    border-top: 1px solid #0e7e94;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 11px;
    color: #cbd5e1;
    align-items: center;
}

/* Print styles */
@media print {
    @page {
        margin: 0.7in;
    }
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    body * {
        visibility: hidden;
    }
    .free-notepad-container,
    .free-notepad-container * {
        visibility: visible;
    }
    .free-notepad-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        max-width: none !important;
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .free-notepad-container .notepad-heading,
    .free-notepad-container .global-toolbar,
    .free-notepad-container .tab-bar,
    .free-notepad-container .tab-tools,
    .free-notepad-container .find-replace-panel,
    .free-notepad-container .modal,
    .free-notepad-container .status-bar,
    .free-notepad-container .line-numbers {
        display: none !important;
    }
    .free-notepad-container .main-area.two-column {
        display: block;
        background: white !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .free-notepad-container .notepad-editor {
        overflow: visible;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        background: white !important;
        color: black !important;
        max-width: none !important;
        width: 100% !important;
    }
}

/* Dark mode – updated with new palette */
.free-notepad-container.word-like.dark-mode {
    background: #111827;
    border-color: #0e7e94;
}
.dark-mode .notepad-heading {
    background: #0b1120;
    color: #e2e8f0;
    border-bottom-color: #0e7e94;
}
.dark-mode .global-toolbar {
    background: #1f2937;
    border-bottom-color: #0e7e94;
}
.dark-mode .tab-bar {
    background: #1f2937;
    border-bottom-color: #0e7e94;
}
.dark-mode .tab-button {
    background: #2d3a4a;
    border-color: #0e7e94;
    color: #e2e8f0;
}
.dark-mode .tab-button:hover {
    background: #0e7e94;
    border-color: #0e7e94;
    color: white;
}
.dark-mode .tab-button.active {
    background: #111827;
    border-color: #0e7e94;
    border-bottom-color: #111827;
    color: #f1f5f9;
}
.dark-mode .toolbar.tab-tools {
    background: #111827;
    border-bottom-color: #0e7e94;
}
.dark-mode .toolbar-btn, .dark-mode .toolbar-select, .dark-mode .toolbar-color, .dark-mode .toolbar-input {
    background: #1f2937;
    border-color: #0e7e94;
    color: #e2e8f0;
}
.dark-mode .toolbar-btn:hover, .dark-mode .toolbar-select:hover, .dark-mode .toolbar-color:hover {
    background: #0b6b7d !important;
    border-color: #0b6b7d;
    color: white;
}
.dark-mode .toolbar-btn.active {
    border-bottom: 2px solid #16a34a;
    background: #2a5a2a;
}
.dark-mode .history-panel .history-title {
    color: #9ca3af;
}
.dark-mode .history-item {
    background: #1f2937;
    border-color: #0e7e94;
    color: #e2e8f0;
}
.dark-mode .history-item:hover {
    background: #0b1120;
    border-color: #0b6b7d;
}
.dark-mode .history-item small {
    color: #9ca3af;
}
.dark-mode .main-area {
    background: #111827;
}
.dark-mode .line-numbers {
    background: #1f2937;
    border-right-color: #0e7e94;
    color: #9ca3af;
}
.dark-mode .notepad-editor {
    color: #e2e8f0;
}
.dark-mode .notepad-editor[placeholder]:empty:before {
    color: #6b7280;
}
.dark-mode .status-bar {
    background: #0b1120;
    border-top-color: #0e7e94;
    color: #9ca3af;
}
.dark-mode .find-replace-panel {
    background: #1f2937;
    border-bottom-color: #0e7e94;
}
.dark-mode .find-input, .dark-mode .replace-input {
    background: #1f2937;
    border-color: #0e7e94;
    color: #e2e8f0;
}
.dark-mode .modal-content {
    background-color: #1f2937;
    color: #e2e8f0;
    border-color: #0e7e94;
}
.dark-mode .close-modal {
    color: #9ca3af;
}
.dark-mode .close-modal:hover {
    color: #0e7e94;
}
.dark-mode .icon-item {
    background: #1f2937;
    border-color: #0e7e94;
    color: #e2e8f0;
}
.dark-mode .icon-item:hover {
    background: #0b6b7d;
    color: white;
}

/* Fullscreen centering */
.free-notepad-container.word-like.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    border: none;
    border-radius: 0;
    background: #fafafa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.free-notepad-container.word-like.fullscreen .notepad-heading,
.free-notepad-container.word-like.fullscreen .global-toolbar,
.free-notepad-container.word-like.fullscreen .tab-bar,
.free-notepad-container.word-like.fullscreen .tab-tools,
.free-notepad-container.word-like.fullscreen .find-replace-panel,
.free-notepad-container.word-like.fullscreen .main-area,
.free-notepad-container.word-like.fullscreen .status-bar {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.free-notepad-container.word-like.fullscreen .main-area {
    flex: 1;
    min-height: 0;
    height: auto;
}
.free-notepad-container.word-like.dark-mode.fullscreen {
    background: #2d2d2d;
}
@media (max-width: 700px) {
    .free-notepad-container.word-like.fullscreen {
        align-items: stretch;
    }
    .free-notepad-container.word-like.fullscreen .notepad-heading,
    .free-notepad-container.word-like.fullscreen .global-toolbar,
    .free-notepad-container.word-like.fullscreen .tab-bar,
    .free-notepad-container.word-like.fullscreen .tab-tools,
    .free-notepad-container.word-like.fullscreen .find-replace-panel,
    .free-notepad-container.word-like.fullscreen .main-area,
    .free-notepad-container.word-like.fullscreen .status-bar {
        max-width: 100%;
    }
}

/* Mobile responsive */
@media (max-width: 700px) {
    .notepad-heading { font-size: 16px; padding: 8px 12px; }
    .global-toolbar, .toolbar.tab-tools { gap: 3px; }
    .toolbar-btn, .toolbar-select, .toolbar-color { padding: 2px 4px; font-size: 10px; min-width: auto; height: 22px; }
    .status-bar { gap: 8px; font-size: 9px; }
    .find-input, .replace-input { min-width: 100px; }
    .tab-button { padding: 4px 8px; font-size: 11px; }
    .history-list { max-height: 80px; }
    .history-item { max-width: 120px; }
    .toolbar-input { width: 60px; }
    .toolbar-color { width: 20px; }
}