:root {
    /* Royal Purple Palette */
    --bg-main: #1A0D2E;
    --primary: #6C5CE7;
    --primary-hover: #8e7ff2;
    --secondary: #A29BFE;
    --accent: #FD79A8;
    --accent-hover: #ff9cbd;

    --glass-bg: rgba(30, 20, 50, 0.45);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

    --text-main: #ffffff;
    --text-muted: #a0a0b0;

    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 255, 255, 0.2);

    --radius: 12px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    background: var(--primary);
    width: 500px;
    height: 500px;
    top: -150px;
    left: -100px;
}

.blob-2 {
    background: var(--accent);
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 30px) scale(1.1);
    }

    100% {
        transform: translate(-20px, 50px) scale(0.9);
    }
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-muted);
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Panels */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--text-main);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

/* Forms */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 120px;
}

.w-full {
    width: 100%;
    flex: 100%;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

input[type="url"],
input[type="date"],
select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
}

/* Custom Select styling for dark mode */
select option {
    background: var(--bg-main);
    color: var(--text-main);
}

/* Range Slider */
.priority-slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 42px;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 6px;
    border-radius: 3px;
    background: var(--input-border);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(253, 121, 168, 0.5);
}

#priority-value,
#edit-priority-value {
    font-family: 'Fira Code', monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    background: transparent;
    padding: 0.5rem;
    color: var(--text-muted);
}

.btn-icon:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: rgba(255, 60, 60, 0.2);
    color: #ff5e5e;
}

.btn-danger:hover {
    background: rgba(255, 60, 60, 0.3);
}

/* Entry List */
.list-card {
    display: flex;
    flex-direction: column;
    height: calc(100% - 320px);
    min-height: 300px;
}

.entries-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

.entries-list::-webkit-scrollbar {
    width: 6px;
}

.entries-list::-webkit-scrollbar-track {
    background: transparent;
}

.entries-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 1rem;
    opacity: 0.7;
    text-align: center;
    padding: 2rem;
}

.entry-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry-item:hover {
    border-color: var(--secondary);
    background: rgba(108, 92, 231, 0.1);
}

.entry-content {
    overflow: hidden;
    flex: 1;
    margin-right: 1rem;
}

.entry-url {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    word-break: break-all;
    color: var(--text-main);
}

.entry-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.entry-actions {
    display: flex;
    gap: 0.25rem;
}

/* Preview Panel */
.preview-panel {
    display: flex;
    flex-direction: column;
}

.code-container {
    flex: 1;
    background: #1e1e1e;
    border-radius: 8px;
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.code-container pre {
    margin: 0;
    padding: 1.5rem;
    height: 100%;
}

.code-container code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
}

/* Syntax Highlighting Fake Classes */
.token.tag {
    color: #569cd6;
}

.token.attr-name {
    color: #9cdcfe;
}

.token.attr-value {
    color: #ce9178;
}

.token.punctuation {
    color: #808080;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    width: 100%;
    max-width: 600px;
    transform: translateY(0) scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.hidden .modal {
    transform: translateY(20px) scale(0.95);
}

.modal h2 {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}