:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.1);
    --primary: #bb86fc;
    --secondary: #03dac6;
    --danger: #cf6679;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: blur(12px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-color);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(187, 134, 252, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(207, 102, 121, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(207, 102, 121, 0.4);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    transition: 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

/* Specific Header Buttons Override */
.header .btn-secondary {
    padding: 0.6rem 2.0rem;
    border-radius: 8px;
    /* Slightly less rounded */
    min-width: 50px;
    /* Ensure some width */
    height: 42px;
    /* Fix height */
    aspect-ratio: auto;
    /* Allow rectangle not square */
}

.header .btn-secondary i {
    font-size: 1.5rem;
}

.logo {
    font-size: 2rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Standard property for newer browsers */
    -webkit-text-fill-color: transparent;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    height: 100%;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--card-color, var(--primary)), transparent);
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
    background: var(--card-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--card-color, var(--text-color));
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    flex-grow: 1;
}

.card-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
}

.card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.card-action-btn {
    padding: 0.4rem;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.card-action-btn:hover {
    color: white;
    background: var(--primary);
}

/* Modal / Form Page */
.manage-container {
    background: var(--glass-bg);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--backdrop-blur);
    padding: 2.5rem;
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    margin: 2rem auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    /* Start hidden */
}

/* Color Grid Styles */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    /* For checkmark */
}

.color-option:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.8);
}

.color-option.active {
    transform: scale(1.1);
    border-color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Icon Grid Styles */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.05);
}

.icon-option:hover {
    background: var(--primary);
    color: black;
    transform: scale(1.1);
}

.icon-option.active {
    background: var(--primary);
    color: black;
    box-shadow: 0 0 10px var(--primary);
}

/* --- Spotlight Overlay Styles --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spotlight-container {
    width: 100%;
    max-width: 600px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.2s;
}

.search-overlay.active .spotlight-container {
    transform: translateY(0);
}

.spotlight-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    background: rgba(255, 255, 255, 0.03);
}

.search-icon-modal {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 1rem;
}

.spotlight-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
}

.spotlight-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.spotlight-shortcut {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.spotlight-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.spotlight-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
    margin-bottom: 2px;
}

.spotlight-item:hover,
.spotlight-item.selected {
    background: rgba(255, 255, 255, 0.1);
}

.spotlight-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-right: 1rem;
    color: var(--item-color, white);
    font-size: 1rem;
}

.spotlight-info {
    flex-grow: 1;
}

.spotlight-title {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 2px;
}

.spotlight-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.spotlight-enter {
    opacity: 0;
    transform: translateX(-10px);
    transition: 0.2s;
    color: rgba(255, 255, 255, 0.5);
}

.spotlight-item.selected .spotlight-enter {
    opacity: 1;
    transform: translateX(0);
}

/* Scrollbar for spotlight */
.spotlight-results::-webkit-scrollbar {
    width: 6px;
}

.spotlight-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 1rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: 0.2s;
    font-weight: 500;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item.active {
    background: var(--primary);
    color: black;
}

.menu-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content {
    flex-grow: 1;
    margin-left: 260px;
    /* Sidebar width */
    padding: 2.5rem;
    width: calc(100% - 260px);
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 2rem 0.5rem;
    }

    .sidebar-brand span,
    .menu-item span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
        padding: 1.5rem;
    }

    .menu-item {
        justify-content: center;
        padding: 1rem 0;
    }

    .menu-item i {
        margin: 0;
    }
}