/* Modern Notepad Editor Styles */
.notepad-editor-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    position: relative;
}

.notepad-editor-container * {
    box-sizing: border-box;
}

.notepad-editor-container :root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

.notepad-editor-container .title-bar {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.notepad-editor-container .file-name {
    font-weight: 600;
    font-size: 1.1em;
}

.notepad-editor-container .datetime {
    font-size: 0.9em;
    opacity: 0.9;
}

.notepad-editor-container .menu-bar {
    background-color: #ecf0f1;
    padding: 8px 15px;
    border-bottom: 1px solid #bdc3c7;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.notepad-editor-container .menu-btn {
    background: white;
    border: 1px solid #bdc3c7;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2c3e50;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
}

.notepad-editor-container .menu-btn:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.notepad-editor-container .color-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 2px solid #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notepad-editor-container .color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.notepad-editor-container .color-red { background-color: #e74c3c; }
.notepad-editor-container .color-yellow { background-color: #f1c40f; }
.notepad-editor-container .color-green { background-color: #27ae60; }
.notepad-editor-container .color-blue { background-color: #3498db; }

.notepad-editor-container .tabs-container {
    background-color: #ecf0f1;
    border-bottom: 1px solid #bdc3c7;
    padding: 0 15px;
    display: flex;
    overflow-x: auto;
}

.notepad-editor-container .tab {
    background-color: #bdc3c7;
    border: none;
    padding: 8px 15px;
    margin-right: 2px;
    cursor: pointer;
    color: #2c3e50;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notepad-editor-container .tab.active {
    background-color: white;
    border-bottom: 2px solid #3498db;
}

.notepad-editor-container .tab-close {
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.8em;
    padding: 2px 4px;
    border-radius: 3px;
}

.notepad-editor-container .tab-close:hover {
    background-color: #e74c3c;
    color: white;
}

.notepad-editor-container .editor-container {
    display: flex;
    height: 400px;
    background-color: white;
    position: relative;
}

.notepad-editor-container .line-numbers {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 10px 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #6c757d;
    user-select: none;
    min-width: 60px;
    text-align: right;
    overflow: hidden;
    white-space: pre;
}

.notepad-editor-container .editor-wrapper {
    flex: 1;
    position: relative;
}

.notepad-editor-container .text-editor {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 10px 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    background-color: transparent;
    overflow-y: auto;
    position: relative;
    z-index: 2;
}

.notepad-editor-container .text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    pointer-events: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    color: transparent;
    z-index: 1;
}

/* Footer / Status Bar */
.notepad-editor-container .footer {
    background-color: #2c3e50;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    flex-wrap: wrap;       /* allow wrapping on smaller screens */
    gap: 8px;              /* spacing when wrapped */
    height: auto;          /* let footer grow */
    min-height: 35px;      /* keep it visible */
    white-space: normal;   /* allow text to wrap */
    box-sizing: border-box;
}

.notepad-editor-container .stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive footer fix */
@media (max-width: 768px) {
    .notepad-editor-container .footer {
        flex-direction: column; /* stack items vertically */
        align-items: flex-start;
        gap: 6px;
        font-size: 0.8em;
    }

    .notepad-editor-container .stats {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }
}

.notepad-editor-container .hidden {
    display: none !important;
}

.notepad-editor-container .highlight-red { background-color: rgba(231, 76, 60, 0.4) !important; }
.notepad-editor-container .highlight-yellow { background-color: rgba(241, 196, 15, 0.4) !important; }
.notepad-editor-container .highlight-green { background-color: rgba(39, 174, 96, 0.4) !important; }
.notepad-editor-container .highlight-blue { background-color: rgba(52, 152, 219, 0.4) !important; }

.notepad-editor-container .notification {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notepad-editor-container .notification.show {
    transform: translateX(0);
}

.notepad-editor-container .notification.error {
    background: #dc3545;
}

/* Modal Styles */
.notepad-editor-container .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notepad-editor-container .modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.notepad-editor-container .modal-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notepad-editor-container .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notepad-editor-container .modal-body {
    padding: 20px;
}

.notepad-editor-container .form-group {
    margin-bottom: 15px;
}

.notepad-editor-container .form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.notepad-editor-container .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.notepad-editor-container .form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.notepad-editor-container .btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.notepad-editor-container .btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.notepad-editor-container .btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

/* Font size controls */
.notepad-editor-container .font-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.notepad-editor-container .font-size-btn {
    width: 32px;
    height: 32px;
    padding: 4px;
    font-size: 12px;
}

.notepad-editor-container .font-size-display {
    min-width: 35px;
    text-align: center;
    font-size: 0.8em;
    color: #2c3e50;
}

/* Find and replace */
.notepad-editor-container .find-replace-panel {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 15px;
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.notepad-editor-container .find-replace-panel.show {
    display: flex;
}

.notepad-editor-container .find-input {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    width: 200px;
}

.notepad-editor-container .find-btn {
    padding: 5px 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

/* Save location styles */
.notepad-editor-container .location-selector {
    margin-bottom: 10px;
}

.notepad-editor-container .location-note {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .notepad-editor-container .menu-bar {
        padding: 5px 10px;
    }
    
    .notepad-editor-container .menu-btn {
        padding: 6px 8px;
        min-width: 35px;
        height: 32px;
    }
    
    .notepad-editor-container .editor-container {
        height: 350px;
    }
    
    .notepad-editor-container .stats {
        gap: 10px;
        font-size: 0.8em;
    }
    
    .notepad-editor-container .modal {
        width: 95%;
    }
    
    .notepad-editor-container .find-input {
        width: 150px;
    }
}