/* CryptoPad - DataEdge Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
    min-height: 100vh;
    color: #e2e8f0;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.7);
}

.sidebar-header h2 {
    font-size: 1.3em;
    color: #60a5fa;
    font-weight: 600;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #34d399);
    color: #000;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.btn-icon:hover {
    background: linear-gradient(135deg, #34d399, #3b82f6);
    transform: scale(1.05);
}

.sidebar-search {
    padding: 16px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.input-search {
    width: 100%;
    padding: 10px 12px;
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.input-search:focus {
    outline: none;
    border-color: #34d399;
    background: rgba(51, 65, 85, 0.8);
}

.input-search::placeholder {
    color: #64748b;
}

.documents-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.document-item {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.document-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #34d399);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(52, 211, 153, 0.3);
    transform: translateX(4px);
}

.document-item:hover::before {
    opacity: 1;
}

.document-item.active {
    background: rgba(52, 211, 153, 0.15);
    border-color: #34d399;
}

.document-item.active::before {
    opacity: 1;
}

.document-title {
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.75em;
    color: #94a3b8;
}

.empty-message {
    text-align: center;
    color: #64748b;
    padding: 40px 20px;
    font-style: italic;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    text-align: center;
}

.info-text {
    font-size: 0.85em;
    color: #94a3b8;
}

/* Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.5);
}

.editor-header {
    padding: 20px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.input-title {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.input-title:focus {
    outline: none;
    border-color: #34d399;
    background: rgba(51, 65, 85, 0.8);
}

.editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #34d399);
    color: #000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #34d399, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #34d399;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.editor-container {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

.editor-textarea {
    width: 100%;
    height: 100%;
    padding: 20px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 1em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.8;
    resize: none;
    transition: all 0.3s ease;
}

.editor-textarea:focus {
    outline: none;
    border-color: #34d399;
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.editor-textarea::placeholder {
    color: #475569;
    line-height: 1.8;
}

.editor-footer {
    padding: 12px 20px;
    background: rgba(30, 41, 59, 0.8);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    font-size: 0.9em;
    color: #94a3b8;
}

.status-text.saved {
    color: #34d399;
}

.status-text.error {
    color: #fca5a5;
}

.char-count {
    font-size: 0.85em;
    color: #64748b;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 211, 153, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    }

    .editor-header {
        flex-direction: column;
        align-items: stretch;
    }

    .input-title {
        width: 100%;
    }

    .editor-actions {
        justify-content: space-between;
    }

    .btn {
        flex: 1;
        font-size: 0.8em;
        padding: 8px 12px;
    }
}
