/* Hacker Notepad Pro - Main Styles */

@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600&family=Roboto+Mono:wght@400;500&family=Ubuntu+Mono:wght@400;700&display=swap');

/* Base Container */
.hacker-notepad-container {
    position: relative;
    background: #000;
    border: 2px solid #0f0;
    border-radius: 8px;
    overflow: hidden;
    font-family: 'Source Code Pro', monospace;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
    animation: terminal-glow 2s ease-in-out infinite alternate;
}

@keyframes terminal-glow {
    from { box-shadow: 0 0 20px rgba(0, 255, 0, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5); }
    to { box-shadow: 0 0 30px rgba(0, 255, 0, 0.6), inset 0 0 30px rgba(0, 0, 0, 0.7); }
}

/* Terminal Header */
.hn-header {
    background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
    border-bottom: 1px solid #0f0;
    padding: 10px;
}

.hn-terminal-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.hn-terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.hn-terminal-dot.red {
    background: #ff5f56;
    box-shadow: 0 0 10px #ff5f56;
}

.hn-terminal-dot.yellow {
    background: #ffbd2e;
    box-shadow: 0 0 10px #ffbd2e;
}

.hn-terminal-dot.green {
    background: #27c93f;
    box-shadow: 0 0 10px #27c93f;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hn-terminal-title {
    color: #0f0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-left: 20px;
    text-shadow: 0 0 10px #0f0;
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    95% { opacity: 0.8; }
}

/* Toolbar */
.hn-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hn-btn {
    background: rgba(0, 255, 0, 0.1);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 8px 15px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hn-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.3), transparent);
    transition: left 0.5s;
}

.hn-btn:hover:before {
    left: 100%;
}

.hn-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px #0f0;
    text-shadow: 0 0 5px #0f0;
}

.hn-icon {
    margin-right: 5px;
}

/* Dropdown Menu */
.hn-dropdown {
    position: relative;
    display: inline-block;
}

.hn-dropdown-content {
    display: none;
    position: absolute;
    background: #000;
    border: 1px solid #0f0;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.hn-dropdown:hover .hn-dropdown-content {
    display: block;
}

.hn-dropdown-content a {
    color: #0f0;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.hn-dropdown-content a:hover {
    background: rgba(0, 255, 0, 0.2);
    text-shadow: 0 0 5px #0f0;
}

/* Status Bar */
.hn-status-bar {
    background: #0a0a0a;
    color: #0f0;
    padding: 5px 10px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #0f0;
    text-transform: uppercase;
}

.hn-status-text::before {
    content: '▶ ';
    animation: blink 1s infinite;
}

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

/* Editor */
.hn-editor-container {
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
}

.hn-note-title {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #0f0;
    color: #0f0;
    font-size: 18px;
    font-weight: 600;
    padding: 10px 0;
    margin-bottom: 20px;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hn-note-title::placeholder {
    color: rgba(0, 255, 0, 0.3);
}

.hn-editor-wrapper {
    display: flex;
    position: relative;
}

.hn-line-numbers {
    display: none;
}

.hn-editor {
    flex: 1;
    background: transparent;
    color: #0f0;
    border: none;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    min-height: 300px;
}

.hn-editor::placeholder {
    color: rgba(0, 255, 0, 0.3);
}

/* Preview */
.hn-preview-container {
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-top: 1px solid #0f0;
}

.hn-preview-header {
    color: #0f0;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hn-preview-content {
    color: #0f0;
    line-height: 1.8;
}

.hn-preview-content h1, .hn-preview-content h2, .hn-preview-content h3 {
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    margin: 20px 0 10px 0;
}

.hn-preview-content code {
    background: rgba(0, 255, 0, 0.1);
    padding: 2px 5px;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.hn-preview-content pre {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.2);
    padding: 15px;
    overflow-x: auto;
}

/* Footer */
.hn-footer {
    background: linear-gradient(to top, #1a1a1a, #0a0a0a);
    border-top: 1px solid #0f0;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hn-timestamp {
    color: #0f0;
    font-size: 11px;
    text-transform: uppercase;
}

/* Modal */
.hn-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.hn-modal-content {
    background: #000;
    margin: 10% auto;
    border: 2px solid #0f0;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.6);
    animation: modal-appear 0.3s ease;
}

@keyframes modal-appear {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hn-modal-header {
    background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
    padding: 15px 20px;
    border-bottom: 1px solid #0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hn-modal-header h3 {
    color: #0f0;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #0f0;
}

.hn-modal-close {
    color: #0f0;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
}

.hn-modal-close:hover {
    text-shadow: 0 0 15px #0f0;
    transform: rotate(90deg);
}

.hn-modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* Notes List */
.hn-note-item {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.3);
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.hn-note-item:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.hn-note-title-list {
    color: #0f0;
    font-weight: 600;
    margin-bottom: 5px;
}

.hn-note-meta {
    color: rgba(0, 255, 0, 0.6);
    font-size: 11px;
}

/* Theme Variations */

/* Cyber Red Theme */
.hacker-notepad-container[data-theme="cyber-red"] {
    border-color: #f00;
}

.hacker-notepad-container[data-theme="cyber-red"] * {
    color: #f00 !important;
    border-color: #f00 !important;
}

.hacker-notepad-container[data-theme="cyber-red"] .hn-btn {
    background: rgba(255, 0, 0, 0.1);
}

.hacker-notepad-container[data-theme="cyber-red"] .hn-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 15px #f00;
}

/* Neon Blue Theme */
.hacker-notepad-container[data-theme="neon-blue"] {
    border-color: #00f0ff;
}

.hacker-notepad-container[data-theme="neon-blue"] * {
    color: #00f0ff !important;
    border-color: #00f0ff !important;
}

.hacker-notepad-container[data-theme="neon-blue"] .hn-btn {
    background: rgba(0, 240, 255, 0.1);
}

/* Purple Rain Theme */
.hacker-notepad-container[data-theme="purple-rain"] {
    border-color: #a020f0;
}

.hacker-notepad-container[data-theme="purple-rain"] * {
    color: #a020f0 !important;
    border-color: #a020f0 !important;
}

.hacker-notepad-container[data-theme="purple-rain"] .hn-btn {
    background: rgba(160, 32, 240, 0.1);
}

/* Amber Terminal Theme */
.hacker-notepad-container[data-theme="amber-terminal"] {
    border-color: #ffb000;
}

.hacker-notepad-container[data-theme="amber-terminal"] * {
    color: #ffb000 !important;
    border-color: #ffb000 !important;
}

.hacker-notepad-container[data-theme="amber-terminal"] .hn-btn {
    background: rgba(255, 176, 0, 0.1);
}

/* Ice Blue Theme */
.hacker-notepad-container[data-theme="ice-blue"] {
    border-color: #80d4ff;
}

.hacker-notepad-container[data-theme="ice-blue"] * {
    color: #80d4ff !important;
    border-color: #80d4ff !important;
}

.hacker-notepad-container[data-theme="ice-blue"] .hn-btn {
    background: rgba(128, 212, 255, 0.1);
}

/* Font Variations */
.hacker-notepad-container[data-font="courier"] {
    font-family: 'Courier New', monospace;
}

.hacker-notepad-container[data-font="consolas"] {
    font-family: 'Consolas', monospace;
}

.hacker-notepad-container[data-font="ubuntu"] {
    font-family: 'Ubuntu Mono', monospace;
}

.hacker-notepad-container[data-font="roboto"] {
    font-family: 'Roboto Mono', monospace;
}

.hacker-notepad-container[data-font="source-code"] {
    font-family: 'Source Code Pro', monospace;
}

/* Fullscreen Mode - Enhanced */
.hacker-notepad-container.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    transition: all 0.3s ease-in-out;
}

/* Fallback fullscreen for browsers without Fullscreen API */
.hacker-notepad-container.fullscreen-fallback {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* Adjust editor in fullscreen mode */
.hacker-notepad-container.fullscreen-active .hn-editor {
    min-height: auto !important;
    transition: height 0.3s ease-in-out;
}

.hacker-notepad-container.fullscreen-active .hn-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hacker-notepad-container.fullscreen-active .hn-editor-wrapper {
    flex: 1;
    overflow: hidden;
}

/* Line numbers removed */

/* Fullscreen transition animation */
@keyframes fullscreen-enter {
    from {
        transform: scale(0.95);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hacker-notepad-container.fullscreen-active {
    animation: fullscreen-enter 0.3s ease-out;
}

/* Fullscreen overlay background */
.hacker-notepad-container.fullscreen-fallback::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: -1;
}

/* Make sure modals appear above fullscreen */
.hn-modal {
    z-index: 100000 !important;
}

/* Scrollbar Styling */
.hn-editor::-webkit-scrollbar,
.hn-modal-body::-webkit-scrollbar {
    width: 10px;
}

.hn-editor::-webkit-scrollbar-track,
.hn-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.hn-editor::-webkit-scrollbar-thumb,
.hn-modal-body::-webkit-scrollbar-thumb {
    background: #0f0;
    border-radius: 5px;
}

.hn-editor::-webkit-scrollbar-thumb:hover,
.hn-modal-body::-webkit-scrollbar-thumb:hover {
    background: #00ff00;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hn-toolbar {
        flex-direction: column;
    }
    
    .hn-btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .hn-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .hn-editor {
        font-size: 12px;
    }
}

/* Loading Animation */
.hn-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 255, 0, 0.3);
    border-radius: 50%;
    border-top-color: #0f0;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auto-save Indicator */
.hn-auto-save-indicator #hn-auto-save-status.active {
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    animation: pulse 1s infinite;
}
