/* ===== SECRET NOTEPAD - MINIMAL & PROFESSIONAL ===== */

.notepad-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    z-index: 99999;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(8px);
}

.notepad-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.notepad-container {
    width: 95%;
    max-width: 1600px;
    height: 92vh;
    background: #1a1a1a;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Sidebar - Minimal & Clean */
.notepad-sidebar {
    width: 260px;
    background: #151515;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.notepad-sidebar.collapsed {
    width: 0;
    border-right: none;
}

.sidebar-header {
    background: #1a1a1a;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 12px;
    color: #999;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
    padding: 0;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

.sidebar-search {
    padding: 10px;
    border-bottom: 1px solid #3d3d3d;
}

.sidebar-search input {
    width: 100%;
    background: #3c3c3c;
    border: 1px solid #555;
    color: #cccccc;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.sidebar-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.sidebar-filter {
    padding: 10px;
    border-bottom: 1px solid #3d3d3d;
}

.sidebar-filter select {
    width: 100%;
    background: #3c3c3c;
    border: 1px solid #555;
    color: #cccccc;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.sidebar-notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.sidebar-note-item {
    background: #2d2d30;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-note-item:hover {
    background: #37373d;
    border-color: #667eea;
    transform: translateX(3px);
}

.sidebar-note-item.active {
    background: #094771;
    border-color: #667eea;
}

.sidebar-note-name {
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-note-icon {
    font-size: 14px;
}

.sidebar-note-preview {
    font-size: 11px;
    color: #858585;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-note-meta {
    font-size: 10px;
    color: #6a6a6a;
    display: flex;
    gap: 10px;
}

.sidebar-empty {
    text-align: center;
    color: #6a6a6a;
    padding: 40px 20px;
    font-size: 13px;
}

/* Main Editor Area */
.notepad-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header - Ultra Minimal */
.notepad-header {
    background: #1a1a1a;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notepad-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    font-family: 'Inter', sans-serif;
}

.notepad-icon {
    font-size: 16px;
    opacity: 0.7;
}

.notepad-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.notepad-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #999;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.notepad-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ccc;
}

.notepad-btn:active {
    transform: scale(0.96);
}

.notepad-btn span:first-child {
    font-size: 14px;
    opacity: 0.8;
}

.notepad-btn.close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.notepad-btn.settings-btn {
    opacity: 0.25;
    padding: 5px 8px;
    transition: all 0.3s ease;
}

.notepad-btn.settings-btn:hover {
    opacity: 0.7;
}

/* Toolbar - Clean & Organized */
.notepad-toolbar {
    background: #1a1a1a;
    padding: 10px 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-section label {
    color: #666;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.toolbar-section input,
.toolbar-section select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ccc;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Consolas', monospace;
}

.toolbar-section input:focus,
.toolbar-section select:focus {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

#notepad-filename {
    min-width: 180px;
    font-weight: 500;
}
.toolbar-section select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#notepad-filename {
    min-width: 200px;
}

/* Editor Wrapper */
.notepad-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Editor */
.notepad-editor {
    flex: 1;
    width: 100%;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    padding: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow: hidden;
}

/* CodeMirror Overrides */
.CodeMirror {
    height: 100% !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    background: #1e1e1e;
    color: #d4d4d4;
}

.CodeMirror-gutters {
    background: #1e1e1e;
    border-right: 1px solid #3d3d3d;
}

.CodeMirror-linenumber {
    color: #858585;
    padding: 0 8px;
}

.CodeMirror-cursor {
    border-left-color: #aeafad;
}

.CodeMirror-selected {
    background: #3a3d41 !important;
}

.CodeMirror-activeline-background {
    background: #2a2d2e !important;
}

/* Light Theme - Better Contrast */
.CodeMirror.cm-s-default {
    background: #ffffff;
    color: #383a42;
}

.CodeMirror.cm-s-default .CodeMirror-gutters {
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
}

.CodeMirror.cm-s-default .CodeMirror-linenumber {
    color: #9d9d9d;
}

.CodeMirror.cm-s-default .CodeMirror-cursor {
    border-left-color: #383a42;
}

.CodeMirror.cm-s-default .CodeMirror-selected {
    background: #d7dae0 !important;
}

.CodeMirror.cm-s-default .CodeMirror-activeline-background {
    background: #f0f0f0 !important;
}

.CodeMirror.cm-s-default .CodeMirror-activeline-gutter {
    background: #e8e8e8;
}

/* Dark Theme (VSCode-like) - Better Contrast */
.CodeMirror.cm-s-dark {
    background: #1e1e1e;
    color: #d4d4d4;
}

.CodeMirror.cm-s-dark .CodeMirror-gutters {
    background: #1e1e1e;
    border-right: 1px solid #3d3d3d;
}

.CodeMirror.cm-s-dark .CodeMirror-linenumber {
    color: #858585;
}

.CodeMirror.cm-s-dark .CodeMirror-cursor {
    border-left-color: #aeafad;
}

.CodeMirror.cm-s-dark .CodeMirror-selected {
    background: #264f78 !important;
}

.CodeMirror.cm-s-dark .CodeMirror-activeline-background {
    background: #282828 !important;
}

.CodeMirror.cm-s-dark .CodeMirror-activeline-gutter {
    background: #2a2a2a;
}

/* Autocomplete popup */
.CodeMirror-hints {
    background: #252526;
    border: 1px solid #454545;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    z-index: 100000;
    max-height: 300px;
    overflow-y: auto;
}

.CodeMirror-hint {
    color: #cccccc;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 3px;
    margin: 2px;
}

.CodeMirror-hint:hover {
    background: #2a2d2e;
    color: #ffffff;
}

li.CodeMirror-hint-active {
    background: #094771 !important;
    color: #ffffff !important;
}

/* Light theme autocomplete */
.CodeMirror.cm-s-default + .CodeMirror-hints,
.CodeMirror-hints.cm-s-default {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.CodeMirror.cm-s-default + .CodeMirror-hints .CodeMirror-hint,
.CodeMirror-hints.cm-s-default .CodeMirror-hint {
    color: #383a42;
}

.CodeMirror.cm-s-default + .CodeMirror-hints .CodeMirror-hint:hover,
.CodeMirror-hints.cm-s-default .CodeMirror-hint:hover {
    background: #e8e8e8;
}

.CodeMirror.cm-s-default + .CodeMirror-hints li.CodeMirror-hint-active,
.CodeMirror-hints.cm-s-default li.CodeMirror-hint-active {
    background: #0066bf !important;
    color: #ffffff !important;
}

.notepad-editor::placeholder {
    color: #6a6a6a;
}

/* Editor Themes */
.notepad-editor[data-theme="light"] {
    background: #ffffff;
    color: #000000;
}

.notepad-editor[data-theme="dark"] {
    background: #1e1e1e;
    color: #d4d4d4;
}

.notepad-editor[data-theme="very-dark"] {
    background: #0d1117;
    color: #c9d1d9;
}

.notepad-editor[data-theme="blue"] {
    background: #001f3f;
    color: #7fdbff;
}

.notepad-editor[data-theme="nord"] {
    background: #2e3440;
    color: #d8dee9;
}

.notepad-editor[data-theme="dracula"] {
    background: #282a36;
    color: #f8f8f2;
}

.notepad-editor[data-theme="monokai"] {
    background: #272822;
    color: #f8f8f2;
}

/* Status Bar - Minimal */
.notepad-status {
    background: #151515;
    padding: 5px 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 10px;
    color: #666;
    font-family: 'Consolas', monospace;
    gap: 12px;
}

#notepad-cursor-pos {
    color: #888;
    font-weight: 500;
}

#notepad-line-count,
#notepad-word-count,
#notepad-char-count {
    color: #666;
}

#notepad-status-text {
    color: #667eea;
    font-weight: 500;
    margin-left: auto;
    font-size: 11px;
}

#notepad-status-text.saving {
    color: #ffa500;
}

#notepad-status-text.error {
    color: #ff6b6b;
}

#notepad-status-text.success {
    color: #51cf66;
}

#notepad-status-text.warning {
    color: #f59e0b;
}

/* Gist Modals */
.gist-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.gist-modal.active {
    display: flex;
}

.gist-modal-content {
    background: #2d2d2d;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gist-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.gist-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-family: 'Inter', sans-serif;
}

.gist-close-btn,
.gist-settings-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gist-close-btn:hover,
.gist-settings-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.gist-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    color: #e0e0e0;
}

/* Gist List Items */
.gist-item {
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gist-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.gist-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.gist-item-desc {
    font-size: 13px;
    color: #b0b0b0;
    margin-bottom: 8px;
}

.gist-item-meta {
    font-size: 12px;
    color: #6a6a6a;
    display: flex;
    gap: 15px;
}

/* Settings Form */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-form label {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 14px;
}

.settings-form input {
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    color: #e0e0e0;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.settings-form input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-form small {
    color: #b0b0b0;
    font-size: 12px;
}

.settings-form small a {
    color: #667eea;
    text-decoration: none;
}

.settings-form small a:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    color: #b0b0b0;
    padding: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .notepad-container {
        width: 95%;
        height: 95vh;
    }
    
    .notepad-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 10;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .notepad-sidebar.collapsed {
        left: -280px;
    }
    
    .notepad-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .toolbar-section {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .toolbar-section input,
    .toolbar-section select {
        width: 100%;
    }
    
    .notepad-controls {
        flex-wrap: wrap;
    }
    
    .notepad-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .notepad-btn span:first-child {
        margin-right: 0;
    }
    
    .notepad-status {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .notepad-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .notepad-title {
        font-size: 16px;
    }
    
    .notepad-editor {
        font-size: 14px;
        padding: 15px;
    }
}

/* ===== PROFESSIONAL UI ENHANCEMENTS ===== */

/* Custom Scrollbar Styling */
.sidebar-notes-list::-webkit-scrollbar,
.CodeMirror-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.sidebar-notes-list::-webkit-scrollbar-track,
.CodeMirror-scroll::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 5px;
}

.sidebar-notes-list::-webkit-scrollbar-thumb,
.CodeMirror-scroll::-webkit-scrollbar-thumb {
    background: #4d4d4d;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.sidebar-notes-list::-webkit-scrollbar-thumb:hover,
.CodeMirror-scroll::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* Smooth Transitions for Buttons */
.notepad-btn,
.sidebar-close-btn,
.modal-close-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.notepad-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.notepad-btn:hover::before {
    width: 300px;
    height: 300px;
}

.notepad-btn:active {
    transform: scale(0.95);
}

/* Enhanced Status Bar */
.notepad-status {
    background: linear-gradient(to right, #2d2d30, #252526);
    border-top: 1px solid #3d3d3d;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.notepad-status span {
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.notepad-status span:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* Sidebar Note Items Animation */
.sidebar-note-item {
    position: relative;
}

.sidebar-note-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #667eea;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-note-item:hover::after,
.sidebar-note-item.active::after {
    opacity: 1;
}

/* Enhanced Modal Animation */
.notepad-container {
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(102, 126, 234, 0.2);
}

/* CodeMirror Enhanced Focus */
.CodeMirror-focused {
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* Loading State */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Success/Error States */
.notepad-status.success {
    background: linear-gradient(to right, #22c55e, #16a34a);
}

.notepad-status.error {
    background: linear-gradient(to right, #ef4444, #dc2626);
}

/* Tooltip Enhancement */
.notepad-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #1a1a1a;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
}

/* Glow Effect for Active Elements */
.notepad-btn.active,
.sidebar-note-item.active {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

/* Professional Typography */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Focus States */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
