:root {
    --bg-dark: #121212;
    --bg-darker: #0a0a0a;
    --accent: #F15A24;
    --accent-hover: #ff7342;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(241, 90, 36, 0.1) 0%, transparent 70%);
    filter: blur(50px);
    border-radius: 50%;
}

.blob-1 {
    top: -200px;
    right: -200px;
}

.blob-2 {
    bottom: -200px;
    left: -200px;
    background: radial-gradient(circle, rgba(241, 90, 36, 0.05) 0%, transparent 70%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

header {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 1.2rem;
    line-height: 1;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--accent);
}

.tagline {
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 10px;
    border-left: 1px solid var(--glass-border);
    padding-left: 10px;
}

.hero {
    text-align: center;
    padding: 100px 0 80px;
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.highlight {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(241, 90, 36, 0.3);
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto;
}

.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.section-header .section-title {
    margin-bottom: 0;
}

.grid {
    display: grid;
    gap: 15px;
}

.apps-grid {
    grid-template-columns: repeat(9, 1fr);
}

@media (max-width: 1200px) {
    .apps-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 900px) {
    .apps-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .bookmark-list {
        grid-template-columns: 1fr;
    }

    .category-group {
        padding: 15px;
    }
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 15px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(241, 90, 36, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.app-card {
    height: 100%;
}

.app-thumbnail {
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--bg-darker);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    z-index: 1;
}

.symbol-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), #ff8c00);
    color: white;
    font-weight: 800;
    font-size: 1.8rem;
    border-radius: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-info h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.app-info p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 0px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* Bookmarks Section */
.bookmarks-container {
    display: grid;
    gap: 30px;
}

.category-group {
    background: rgba(20, 20, 20, 0.5);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--glass-border);
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--accent);
}

.bookmark-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.bookmark-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: 0.2s;
}

.bookmark-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.3s;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(241, 90, 36, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 90, 36, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: var(--glass-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-small:hover {
    background: var(--accent);
    color: white;
}

.w-full {
    width: 100%;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    max-width: 500px;
    width: 100%;
    background: #1a1a1a;
    border: 1px solid var(--accent);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-darker);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    outline: none;
}

input:focus {
    border-color: var(--accent);
}

/* Footer */
footer {
    padding: 60px 0 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero {
        padding: 40px 0;
    }
}

/* Drag and Drop & Sorting */
.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    z-index: 10;
}

.card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: var(--accent);
}

.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(241, 90, 36, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    opacity: 0;
    transition: 0.2s;
    pointer-events: none;
}

.app-card.drag-over .drop-overlay {
    opacity: 1;
}

.app-card.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent);
}

.sorting-active {
    cursor: grab !important;
    border: 2px dashed var(--accent) !important;
    animation: shake 0.5s ease-in-out infinite alternate;
}

@keyframes shake {
    from {
        transform: rotate(-0.5deg);
    }

    to {
        transform: rotate(0.5deg);
    }
}

.sort-over {
    transform: scale(1.05);
    background: rgba(241, 90, 36, 0.2) !important;
}

.sort-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--accent);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    z-index: 5;
}

.btn-active {
    background: var(--accent) !important;
    color: white !important;
    box-shadow: 0 0 15px var(--accent);
}

/* Bookmark Sorting */
.bookmark-item {
    position: relative;
    display: flex;
    align-items: center;
    transition: transform 0.2s, opacity 0.2s;
}

.delete-small {
    margin-left: -20px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    opacity: 0;
    transition: 0.2s;
    z-index: 5;
}

.bookmark-item:hover .delete-small {
    opacity: 1;
    margin-left: 5px;
}

.delete-small:hover {
    color: var(--accent);
}

.sorting-active-item {
    cursor: grab;
    user-select: none;
    border: 1px dashed var(--accent) !important;
    animation: shake 0.5s ease-in-out infinite alternate;
}

.sorting-active-item:active {
    cursor: grabbing;
}

.bookmark-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.bookmark-list.list-over {
    background: rgba(241, 90, 36, 0.05);
    border-radius: 8px;
    padding: 5px;
    min-height: 50px;
}

.sort-handle-small {
    color: var(--accent);
    margin-right: 8px;
    font-weight: bold;
    cursor: grab;
}

/* Category Sorting & Header */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.category-title {
    margin-bottom: 0 !important;
    border-bottom: none !important;
    flex-grow: 1;
}

.sorting-active-group {
    border: 2px dashed rgba(241, 90, 36, 0.3) !important;
    margin-bottom: 20px;
    background: rgba(241, 90, 36, 0.02) !important;
}

.sort-handle-category {
    color: var(--accent);
    margin-right: 15px;
    font-size: 1.5rem;
    cursor: grab;
    user-select: none;
}

.category-group.dragging-group {
    opacity: 0.4;
    transform: scale(0.98);
}

.empty-list-placeholder {
    padding: 20px;
    text-align: center;
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.category-title[onclick]:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    cursor: pointer;
}