* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --dark-color: #121826;
    --light-color: #f8f9fa;
    --success-color: #4ade80;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --border-radius: 10px;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-color);
    color: var(--light-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    color: var(--accent-color);
    font-size: 28px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-controls {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #22c55e;
    transform: translateY(-2px);
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.sidebar {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 25px;
    height: fit-content;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar h2 i {
    font-size: 18px;
}

.categories-list {
    list-style: none;
    margin-bottom: 30px;
}

.category-item {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.category-item.active {
    background-color: rgba(67, 97, 238, 0.2);
    border-left: 4px solid var(--primary-color);
}

.category-count {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.stats {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 20px;
}

.stats h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--gray-300);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: var(--accent-color);
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.snippets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.snippets-header h2 {
    font-size: 24px;
    color: var(--light-color);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: white;
    font-size: 15px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-300);
}

.snippets-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

@media (max-width: 768px) {
    .snippets-container {
        grid-template-columns: 1fr;
    }
}

.snippet-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 25px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.snippet-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: rgba(67, 97, 238, 0.3);
}

.snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.snippet-title {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.snippet-language {
    display: inline-block;
    padding: 5px 12px;
    background-color: rgba(67, 97, 238, 0.2);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.snippet-description {
    color: var(--gray-300);
    margin-bottom: 20px;
    flex-grow: 1;
}

.snippet-code {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    overflow-x: auto;
    margin-bottom: 20px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.snippet-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.action-btn {
    padding: 8px 15px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    flex-grow: 1;
    justify-content: center;
}

.action-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.action-btn.edit {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.action-btn.edit:hover {
    background-color: rgba(245, 158, 11, 0.3);
}

.action-btn.delete {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.action-btn.delete:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--dark-color);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    color: white;
}

.close-modal {
    background: none;
    border: none;
    color: var(--gray-300);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: white;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--gray-300);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.code-editor {
    background-color: #1e1e1e;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 25px;
}

.editor-header {
    background-color: #252526;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.editor-header select {
    background-color: #3c3c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
}

.editor-body {
    padding: 15px;
}

.editor-body textarea {
    width: 100%;
    min-height: 200px;
    background-color: #1e1e1e;
    border: none;
    color: #d4d4d4;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.editor-body textarea:focus {
    outline: none;
}

.modal-footer {
    padding: 25px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.empty-state i {
    font-size: 60px;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
}

.empty-state p {
    color: var(--gray-300);
    max-width: 500px;
    margin: 0 auto 25px;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background-color: var(--success-color);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background-color: var(--danger-color);
}

.toast.warning {
    background-color: var(--warning-color);
}

footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray-300);
    font-size: 14px;
}

.view-snippet-modal .modal-content {
    max-width: 900px;
}

.view-snippet-code {
    background-color: #1e1e1e;
    border-radius: var(--border-radius);
    padding: 20px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}