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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.2);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--glass-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 420px;
    animation: slideUp 0.4s ease;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

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

.editor-modal {
    max-width: 650px;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #1a1a2e;
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: #f8fafc;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-group textarea {
    resize: vertical;
    font-family: 'Fira Code', 'Courier New', monospace;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
}

.btn {
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #4a5568;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.5);
}

#password-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    background: #f8fafc;
    transition: var(--transition);
}

#password-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

#login-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
}

.error {
    color: #e53e3e;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

#main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    background: var(--glass-bg);
    padding: 2rem 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

header h1 {
    color: #1a1a2e;
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logout-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
    transition: var(--transition);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 101, 101, 0.4);
}

.tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    padding: 0.85rem 2rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #718096;
    transition: var(--transition);
    position: relative;
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.toolbar {
    margin-bottom: 1.5rem;
}

.list-container {
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    min-height: 300px;
}

.item-card {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
}

.item-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: #cbd5e0;
}

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

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.item-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.item-description {
    color: #718096;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.item-content {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #4a5568;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.7;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.item-content::-webkit-scrollbar {
    width: 8px;
}

.item-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.item-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.item-date {
    font-size: 0.85rem;
    color: #a0aec0;
    font-weight: 500;
}

.item-actions {
    display: flex;
    gap: 0.6rem;
}

.item-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #a0aec0;
}

.empty-state p {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #718096;
}

.empty-state small {
    font-size: 0.95rem;
    color: #a0aec0;
}

.item-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    #main-content {
        padding: 1rem;
    }
    
    header {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .item-card {
        padding: 1.25rem;
    }
    
    .item-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

#file-editor-container {
    padding: 1.5rem;
}

#file-editor {
    width: 100%;
    min-height: 400px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #2d3748;
    resize: vertical;
    transition: all 0.3s ease;
}

#file-editor:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #ffffff;
}

#file-editor::placeholder {
    color: #a0aec0;
}

#file-editor-container .form-group {
    margin-bottom: 1.5rem;
}

#file-editor-container .form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

#file-editor-container .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}
