/* Design Tokens */
:root {
    --bg-primary: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;

    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.4);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.2);

    --error: #ef4444;

    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Dynamic background gradients */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 40%);
}

.glass-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(15, 15, 25, 0.8) 0%, #0a0a0f 100%);
    z-index: -2;
}

/* App Container */
.container {
    width: 100%;
    max-width: 600px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* App Header */
.app-header {
    text-align: center;
}

.logo-area {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary-glow);
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.app-header h1 span {
    background: linear-gradient(to right, var(--primary), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 300;
}

/* Cards (Glassmorphism) */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
    display: none;
    opacity: 0;
    transform: translateY(10px);
    margin-bottom: 8rem;
}

.card.active-view {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

h2#view-list-title {
    color: var(--primary);
    font-size: 2.5rem;
    line-height: 2.5rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

textarea {
    resize: none;
}

/* Add Item Input Group */
.input-add-group {
    display: flex;
    gap: 8px;
}

.input-add-group input {
    flex: 1;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
    filter: brightness(1.1);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--text-secondary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

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

/* Preview Items List */
.preview-list {
    list-style: none;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.preview-list::-webkit-scrollbar {
    width: 4px;
}

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

.preview-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.25s ease-out;
}

.preview-item span {
    font-size: 0.95rem;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--error);
    opacity: 0.6;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-remove-item:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* List View Header & Status */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sync-dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Share Box */
.share-box {
    background: rgba(139, 92, 246, 0.05);
    border: 1px dashed rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.share-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

.share-input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--primary-hover);
    outline: none;
    text-overflow: ellipsis;
}

/* Collaborative List Area */
.items-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.items-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.counter-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.collaborative-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Collaborative List Item */
.list-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.list-item:hover:not(.claimed) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-title {
    font-weight: 500;
    font-size: 1.05rem;
}

.claimed-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.claimed-badge i {
    width: 12px;
    height: 12px;
}

/* Actions buttons in item list */
.btn-claim-item {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-claim-item:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 10px var(--primary-glow);
}

.btn-unclaim-item {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-unclaim-item:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* State when item is claimed */
.list-item.claimed {
    background: rgba(16, 185, 129, 0.02);
    border-color: var(--success-border);
}

.list-item.claimed .item-title {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: var(--transition-smooth);
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: #0f0f18;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 400px;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

.modal-backdrop.active .modal {
    transform: scale(1);
}

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

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #14141e;
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(100px);
    opacity: 0;
    z-index: 1000;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.9);
    }
}

/* Responsive styles */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .card {
        padding: 20px;
    }

    .app-header h1 {
        font-size: 1.8rem;
    }
}

/* Custom Checkbox */
.item-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.item-checkbox:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.item-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.item-checkbox:checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Floating Action Bar / Bottom Toast */
.floating-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #6d28d9;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--primary-glow);
    padding: 16px 24px;
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 99;
    opacity: 0;
    transition: var(--transition-smooth);
    width: 90%;
    max-width: 450px;
    justify-content: space-between;
}

.floating-bar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.floating-bar-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-floating-action {
    background: linear-gradient(135deg, #000, #222);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-floating-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
    filter: brightness(1.1);
}