:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #58a6ff;
    --secondary: #161b22;
    --text-main: #f0f6fc;
    --text-dim: #8b949e;
    
    /* Priority Colors */
    --p-high: #ff7b72;
    --p-medium: #d29922;
    --p-low: #3fb950;
    
    /* Gradients */
    --accent-gradient: linear-gradient(135deg, #58a6ff, #bc8cff);
    --card-gradient: linear-gradient(145deg, rgba(33, 38, 45, 0.4), rgba(13, 17, 23, 0.8));
    
    /* Layout */
    --container-max: 900px;
}

/* Pink Theme Variables */
[data-theme="pink"] {
    --bg-color: #1a0f14;
    --card-bg: rgba(45, 15, 30, 0.7);
    --glass-border: rgba(255, 102, 163, 0.15);
    --primary: #ff66a3;
    --secondary: #2d0f1e;
    --text-dim: #eba0c4;
    
    /* Priority Colors Tweaks */
    --p-high: #ff4d4d;
    --p-medium: #ff9933;
    --p-low: #66cc66;
    
    --accent-gradient: linear-gradient(135deg, #ff66a3, #ffb3d9);
    --card-gradient: linear-gradient(145deg, rgba(80, 20, 50, 0.4), rgba(45, 15, 30, 0.8));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Blobs for Visual depth */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    filter: blur(100px);
    opacity: 0.4;
}

.blob {
    position: absolute;
    border-radius: 50%;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #1e3a8a;
    top: -100px;
    left: -100px;
    animation: move 20s infinite alternate;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #4c1d95;
    bottom: -150px;
    right: -150px;
    animation: move 25s infinite alternate-reverse;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #064e3b;
    top: 40%;
    right: 20%;
    animation: move 18s infinite alternate;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 100px) scale(1.2); }
}

/* Pink Theme Specific Blobs */
[data-theme="pink"] .blob-1 { background: #5c1439; }
[data-theme="pink"] .blob-2 { background: #962858; }
[data-theme="pink"] .blob-3 { background: #3b0f20; }

/* Stars Pattern (Only visible in pink theme if disabled elsewhere, or specifically styled) */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
}

[data-theme="pink"] .stars {
    opacity: 0.6;
    animation: twinkle 4s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header Update */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-top: 5px;
    margin-bottom: 30px;
    text-align: left;
}

/* Modal and Interactive States */
.hidden { display: none !important; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Empty State override: modal doesn't cover screen */
.modal-overlay.is-inline {
    position: relative;
    width: auto;
    height: auto;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    display: block;
}

.modal-overlay.is-popup .input-section {
    width: 100%;
    max-width: 600px;
    margin: 0;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: var(--text-main);
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-dim);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255, 123, 114, 0.2);
    color: var(--p-high);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.input-section {
    padding: 35px;
    margin-bottom: 40px;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

/* UI Elements */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.input-section {
    padding: 30px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-left: 5px;
}

input[type="text"],
input[type="url"],
input[type="number"] {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.15);
    background: rgba(13, 17, 23, 0.8);
}

/* Form Layout Classes */
.input-row {
    display: flex;
    gap: 20px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.align-end { align-items: flex-end; }

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-helper-btn {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: var(--primary);
    padding: 13px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.search-helper-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.2);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    color: var(--text-dim);
}

.input-with-icon input {
    padding-left: 45px;
}

/* Priority & Buttons */
.priority-selector {
    display: flex;
    gap: 10px;
    background: rgba(13, 17, 23, 0.6);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    width: fit-content;
}

.priority-selector input[type="radio"] {
    display: none;
}

.p-btn {
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-dim);
    text-align: center;
    border: 1px solid transparent;
}

.priority-selector input:checked + .p-btn.low { 
    background: rgba(63, 185, 80, 0.15); 
    color: var(--p-low); 
    border-color: rgba(63, 185, 80, 0.4);
    box-shadow: 0 4px 12px rgba(63, 185, 80, 0.1);
}

.priority-selector input:checked + .p-btn.medium { 
    background: rgba(210, 153, 34, 0.15); 
    color: var(--p-medium); 
    border-color: rgba(210, 153, 34, 0.4);
    box-shadow: 0 4px 12px rgba(210, 153, 34, 0.1);
}

.priority-selector input:checked + .p-btn.high { 
    background: rgba(255, 123, 114, 0.15); 
    color: var(--p-high); 
    border-color: rgba(255, 123, 114, 0.4);
    box-shadow: 0 4px 12px rgba(255, 123, 114, 0.1);
}

.primary-btn {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 20px;
    height: 52px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(88, 166, 255, 0.4);
}

/* List Controls Update */
.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.stat-card {
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 1000;
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
}

.actions-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.backup-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.backup-btn:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Grid Layout Update */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

.item-card {
    position: relative;
    padding: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    height: 120px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.item-card:hover {
    background: rgba(33, 38, 45, 0.9);
    transform: translateY(-5px);
}

.item-image-container {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.item-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.item-card:hover .item-image-container img {
    transform: scale(1.1);
}

.item-priority-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    border-radius: 0 4px 4px 0;
}

.priority-high-bg { background-color: var(--p-high); }
.priority-medium-bg { background-color: var(--p-medium); }
.priority-low-bg { background-color: var(--p-low); }

.item-main {
    flex: 1;
}

.item-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-name a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.item-name a:hover {
    color: var(--primary);
}

.item-price {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 500;
}

.item-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.edit-btn {
    background: rgba(88, 166, 255, 0.1);
    border: none;
    color: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: var(--primary);
    color: #fff;
}

.delete-btn {
    background: rgba(255, 123, 114, 0.1);
    border: none;
    color: var(--p-high);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: var(--p-high);
    color: #fff;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--text-dim);
}

.empty-state i {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    padding: 16px 24px;
    background: rgba(22, 27, 34, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInLeft 0.3s ease forwards;
    min-width: 250px;
}

.toast-success i { color: var(--p-low); }
.toast-error i { color: var(--p-high); }
.toast-info i { color: var(--primary); }

@keyframes slideInLeft {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Custom Confirm Modal Refined */
.confirm-card {
    width: 90%;
    max-width: 380px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid rgba(255, 123, 114, 0.3);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 123, 114, 0.15);
    color: var(--p-high);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    box-shadow: 0 0 20px rgba(255, 123, 114, 0.1);
}

.confirm-icon i {
    width: 32px;
    height: 32px;
}

#confirm-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

#confirm-message {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0 0 10px 0;
    text-align: center;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 15px;
}

.confirm-actions .p-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 0.9rem;
    height: auto;
    justify-content: center;
}

#confirm-ok {
    background: var(--p-high);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 123, 114, 0.3);
}

#confirm-ok:hover {
    transform: translateY(-2px);
    background: #ff8e85;
}

#confirm-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

#confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Generic Icon Fallback */
.no-image-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    color: var(--text-dim);
}

.no-image-placeholder i {
    width: 32px;
    height: 32px;
    opacity: 0.4;
}
/ *   R e s p o n s i v e   * / 
 @ m e d i a   ( m a x - w i d t h :   6 0 0 p x )   { 
         . i n p u t - r o w   {   f l e x - d i r e c t i o n :   c o l u m n ;   g a p :   0 ;   } 
         . l o g o - t e x t   {   f o n t - s i z e :   2 . 2 r e m ;   } 
         . l i s t - c o n t r o l s   {   f l e x - d i r e c t i o n :   c o l u m n ;   g a p :   2 0 p x ;   a l i g n - i t e m s :   s t r e t c h ;   } 
         . i t e m - c a r d   {   p a d d i n g :   1 5 p x ;   } 
 }  
 