:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --bg-light: #fafbfc;
    --bg-dark: #0a0e1a;
    --card-light: #ffffff;
    --card-dark: #151b2d;
    --text-light: #1e293b;
    --text-dark: #f1f5f9;
    --text-muted-light: #64748b;
    --text-muted-dark: #94a3b8;
    --border-light: #e2e8f0;
    --border-dark: #1e293b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    min-height: 100vh;
    transition: background 0.4s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted-light);
    border-radius: 5px;
    border: 3px solid transparent;
    background-clip: content-box;
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--text-muted-dark);
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

body[data-theme="dark"] {
    background: var(--bg-dark);
    color: var(--text-dark);
}

body[data-theme="dark"]::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    animation: slideDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

body[data-theme="dark"] .logo-subtitle {
    color: var(--text-muted-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    background: var(--card-light);
    color: var(--text-muted-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

body[data-theme="dark"] .btn-icon {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-muted-dark);
}

.btn-icon:hover, .btn-icon.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.admin-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.search-container {
    position: relative;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease 0.2s both;
}

.search-box {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text-light);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

body[data-theme="dark"] .search-box {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted-light);
    font-size: 1.25rem;
}

body[data-theme="dark"] .search-icon {
    color: var(--text-muted-dark);
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

body[data-theme="dark"] .view-toggle {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted-light);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

body[data-theme="dark"] .view-btn {
    color: var(--text-muted-dark);
}

.view-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.8s ease 0.4s both;
}

.stat-card {
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

body[data-theme="dark"] .stat-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted-light);
    margin-top: 0.25rem;
}

body[data-theme="dark"] .stat-label {
    color: var(--text-muted-dark);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding-bottom: 2rem;
}

.cards-grid.list-view {
    grid-template-columns: 1fr;
}

.card {
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.75rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s ease both;
    display: flex;
    flex-direction: column;
}

body[data-theme="dark"] .card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card:hover::before {
    transform: scaleX(1);
}

.card.dragging {
    opacity: 0.5;
    transform: rotate(3deg) scale(0.95);
    cursor: grabbing;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

body[data-theme="dark"] .card-title {
    color: var(--text-dark);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted-light);
    line-height: 1.5;
    flex-grow: 1;
}

body[data-theme="dark"] .card-desc {
    color: var(--text-muted-dark);
}

/* List View Overrides */
.list-view .card {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.75rem;
}

.list-view .card-icon {
    margin-bottom: 0;
    font-size: 2rem;
}

.list-view .card:hover .card-icon {
    transform: scale(1.1);
}

.list-view .card-content {
    flex: 1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.4s ease;
}

body[data-theme="dark"] .modal-content {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted-light);
    transition: var(--transition);
}

body[data-theme="dark"] .modal-close {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-muted-dark);
}

.modal-close:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-light);
}

body[data-theme="dark"] .form-group label {
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-light);
    transition: var(--transition);
    font-family: inherit;
}

body[data-theme="dark"] .form-group input,
body[data-theme="dark"] .form-group textarea {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    color: var(--text-light);
}

body[data-theme="dark"] .btn-secondary {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

.btn-secondary:hover {
    border-color: var(--text-muted-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted-light);
}

body[data-theme="dark"] .empty-state {
    color: var(--text-muted-dark);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-muted-light);
    font-size: 0.9rem;
}

body[data-theme="dark"] footer {
    border-color: var(--border-dark);
    color: var(--text-muted-dark);
}

/* Context Menu */
.context-menu {
    position: fixed;
    z-index: 10000;
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
    min-width: 180px;
    display: none;
    animation: fadeIn 0.2s ease;
}

body[data-theme="dark"] .context-menu {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.context-menu-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    transition: var(--transition);
    font-size: 0.9rem;
}

body[data-theme="dark"] .context-menu-item {
    color: var(--text-dark);
}

.context-menu-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

body[data-theme="dark"] .context-menu-item:hover {
    background: var(--bg-dark);
}

.context-menu-item.delete {
    color: #ef4444;
}

.context-menu-item.delete:hover {
    background: #fef2f2;
}

body[data-theme="dark"] .context-menu-item.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: var(--card-light);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideLeft 0.3s ease;
    min-width: 300px;
}

body[data-theme="dark"] .toast {
    background: var(--card-dark);
    color: var(--text-dark);
}

.toast.success { border-color: #10b981; }
.toast.error { border-color: #ef4444; }
.toast.info { border-color: var(--primary); }

@keyframes slideLeft {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .logo-title { font-size: 1.5rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .header-actions { gap: 0.5rem; }
    .view-toggle { display: none; } /* Consider keeping it for mobile users who want control */
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .toast {
        min-width: auto;
        width: 100%;
    }
}
/* Login Overlay */
.blur-sm {
    filter: blur(8px);
    pointer-events: none;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

body[data-theme='dark'] .login-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.login-card {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

body[data-theme='dark'] .login-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

body[data-theme='dark'] .login-title {
    color: var(--text-dark);
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted-light);
    margin-bottom: 2rem;
}
