:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --accent-color: #3b82f6;
    --font-main: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    width: 100%;
    overflow: hidden;
    background: #000;
    display: flex;
    flex-direction: column;
}

#app-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.top-bar {
    position: relative;
    z-index: 10;
    height: 50px;
    width: 100%;
    flex-shrink: 0;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--glass-border);
}

.left-section {
    display: flex;
    align-items: center;
    height: 100%;
}

.atlas-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-right: 10px;
}

.atlas-logo svg {
    width: 24px;
    height: 24px;
}

.groups-container {
    display: flex;
    gap: 2px;
    height: 100%;
    overflow-x: auto;
    /* Allow scrolling if many groups */
    overflow-y: hidden;
    max-width: 60vw;
    /* Prevent it from taking too much space pushing right section */
    scrollbar-width: none;
    /* Hide scrollbar for cleaner look */
}

/* Hide scrollbar for Chrome/Safari/Opera */
.groups-container::-webkit-scrollbar {
    display: none;
}

.group-tab {
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    /* Slightly thicker for better visibility */
    opacity: 0.6;
    transition: var(--transition);
    user-select: none;
}

.group-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
}

.group-tab.active {
    opacity: 1;
    border-bottom-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.right-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px;
    /* Adjusted */
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5vh;
    /* Adjusted */
    padding-bottom: 40px;
    /* Space for grid padding */
    z-index: 5;
    position: relative;
    overflow-y: auto;
    /* Enable scrolling */
    overflow-x: hidden;
    /* Fix horizontal scroll */
}

/* Custom Scrollbar */
.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 50px;
}

.search-box {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.search-box:focus-within {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.search-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    outline: none;
}



/* Shortcuts Grid */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 120px));
    gap: 30px;
    width: 90%;
    max-width: 1000px;
    justify-content: center;
    padding: 20px;
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: white;
}

.shortcut-item:hover {
    transform: scale(1.05);
}

.shortcut-item .shortcut-actions {
    position: absolute;
    top: -5px;
    right: -5px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.shortcut-item:hover .shortcut-actions {
    opacity: 1;
}

.action-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.action-btn.delete:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

.icon-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    overflow: hidden;
}

.shortcut-item:hover .icon-wrapper {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.icon-wrapper img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.shortcut-name {
    font-size: 0.85rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.add-shortcut-icon {
    font-size: 32px;
    color: white;
    font-weight: 300;
}

/* Footer */
.bottom-bar {
    height: 40px;
    width: 100%;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 0.8rem;
    position: relative;
    z-index: 10;
}

.bottom-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sort Select */
.sort-container {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.sort-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sort-select:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.15);
}

.sort-select option {
    background: #1e1e1e;
    color: white;
}

::selection {
    background: var(--accent-color);
    color: white;
}

/* Drag and Drop */
.shortcut-item.dragging {
    opacity: 0.4;
    transform: scale(0.9);
}

.shortcut-item.drag-over {
    border: 2px dashed var(--accent-color);
    border-radius: 16px;
}

.personalize-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.personalize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.personalize-btn svg {
    width: 14px;
    height: 14px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 500;
}

.close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: var(--transition);
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.form-group input,
.form-group-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.form-group-select option {
    background: #1e1e1e;
    color: white;
}

.form-group input:focus,
.form-group-select:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.logo-preview-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-preview {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.logo-preview .placeholder-icon {
    font-size: 2.5rem;
    font-weight: 600;
    opacity: 0.5;
}

.icon-candidates-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.icon-candidate {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.icon-candidate:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.icon-candidate.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
    background: rgba(255, 255, 255, 0.2);
}

.icon-candidate img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.modal-content.alert {
    max-width: 320px;
    text-align: center;
}

#alert-modal,
#confirm-modal {
    z-index: 200;
}

.modal-content.alert .modal-body {
    padding: 30px 20px;
}

.modal-content.alert .modal-footer {
    justify-content: center;
    border-top: none;
    padding-top: 0;
}

.modal-tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 10px;
}

.modal-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 8px;
    opacity: 0.6;
    transition: var(--transition);
}

.modal-tab.active {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    font-weight: 500;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .shortcuts-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 100px));
        gap: 20px;
    }

    .icon-wrapper {
        width: 54px;
        height: 54px;
    }
}