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

:root {
    /* Color System */
    --primary: 250 84% 64%;
    --primary-glow: 280 84% 74%;
    --secondary: 240 10% 15%;
    --background: 0 0% 0%;
    --foreground: 0 0% 95%;
    --muted: 240 10% 15%;
    --muted-foreground: 0 0% 70%;
    --accent: 280 84% 74%;
    --destructive: 0 84% 60%;
    --border: 240 10% 20%;
    --input: 240 10% 12%;
    --ring: 250 84% 64%;
    --card-bg: 240 10% 8%;
    --text-primary: 0 0% 95%;
    --text-secondary: 0 0% 65%;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(250, 84%, 64%), hsl(280, 84%, 74%));
    --gradient-secondary: linear-gradient(135deg, hsl(200, 84%, 64%), hsl(250, 84%, 64%));
    --gradient-accent: linear-gradient(135deg, hsl(280, 84%, 74%), hsl(320, 84%, 74%));
    --gradient-background: linear-gradient(180deg, hsl(0, 0%, 0%), hsl(240, 10%, 3%));
    
    /* Shadows */
    --shadow-elegant: 0 10px 30px -10px hsla(250, 84%, 64%, 0.5);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px hsla(280, 84%, 74%, 0.6);
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gradient-background);
    color: hsl(var(--foreground));
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid hsl(var(--border));
}

.header-content {
    margin-bottom: 2rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

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

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-elegant);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: hsl(var(--secondary));
    color: var(--text-primary);
    border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
    background: hsl(var(--muted));
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid hsl(var(--border));
}

.btn-ghost:hover {
    background: hsl(var(--muted));
    color: var(--text-primary);
}

.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-danger {
    background: hsl(var(--destructive));
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-add-circular {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.btn-add-circular i {
    margin: 0;
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid hsl(var(--border));
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: var(--transition-smooth);
    background: hsl(var(--input));
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsla(250, 84%, 64%, 0.1);
}

.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    font-size: 1rem;
    background: hsl(var(--input));
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-select:focus {
    outline: none;
    border-color: hsl(var(--primary));
}

/* Bookmarks Grid */
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.bookmark-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    border: 1px solid hsl(var(--border));
}

.bookmark-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elegant);
    border-color: hsl(var(--primary));
}

.bookmark-header {
    display: flex;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bookmark-favicon {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    flex-shrink: 0;
    background: hsl(var(--muted));
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-favicon img {
    width: 24px;
    height: 24px;
}

.bookmark-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.bookmark-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.bookmark-url {
    color: hsl(var(--primary));
    font-size: 0.85rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    word-break: break-all;
}

.bookmark-url:hover {
    text-decoration: underline;
}

.bookmark-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-category {
    background: var(--gradient-primary);
    color: white;
}

.badge-tag {
    background: hsl(var(--secondary));
    color: var(--text-primary);
    border: 1px solid hsl(var(--border));
}

.bookmark-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.favorite-active {
    color: #fbbf24;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-elegant);
    border: 1px solid hsl(var(--border));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

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

.modal-content form {
    padding: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-smooth);
    background: hsl(var(--input));
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsla(250, 84%, 64%, 0.1);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid hsl(var(--border));
}

/* List View */
.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bookmark-list-item {
    background: var(--card-bg);
    border: 1px solid hsl(var(--border));
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.bookmark-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elegant);
    border-color: hsl(var(--primary));
}

.bookmark-list-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.bookmark-list-info {
    flex: 1;
    min-width: 0;
}

.bookmark-list-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .bookmark-list-item {
        flex-direction: column;
    }
    
    .bookmark-list-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .bookmark-list-right .bookmark-meta {
        justify-content: flex-start;
    }
    
    .bookmark-list-right .bookmark-actions {
        justify-content: center;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-subtitle {
    font-size: 1rem;
    opacity: 0.7;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .bookmarks-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
}
