:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);
    
    --primary-gradient: linear-gradient(135deg, #7B2EFF, #00C2FF);
    --accent-pink: #FF2E88;
    --accent-purple: #7B2EFF;
    --accent-blue: #00C2FF;
    --accent-cyan: #00f2fe;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    --glow-shadow: 0 0 30px rgba(123, 46, 255, 0.2);
}

.light-mode {
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.5s ease;
}

body.dark-mode::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(123, 46, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Cursor Aura */
.cursor-aura {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(123, 46, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    will-change: transform;
}

/* Updated Animated Background (Mesh Gradient) */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: #050505;
    overflow: hidden;
}

.animated-bg::before, .animated-bg::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(123, 46, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 194, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 46, 136, 0.1) 0%, transparent 50%);
    animation: meshMove 20s ease-in-out infinite alternate;
}

@keyframes meshMove {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(10deg) scale(1.1); }
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: 30px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 0 15px rgba(0, 194, 255, 0.4);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(123, 46, 255, 0.2);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: var(--transition);
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    margin-left: auto;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.dark-mode .toggle-switch::after {
    transform: translateX(20px);
    background: var(--accent-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.glow-text {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #ffffffaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 8px 15px 8px 15px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
}

.profile-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.profile-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-status {
    font-size: 0.75rem;
    color: var(--accent-blue);
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.8rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-wrapper input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 15px 15px 15px 50px;
    border-radius: 16px;
    color: white;
    outline: none;
    transition: var(--transition);
    font-size: 1rem;
}

.search-wrapper input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 194, 255, 0.1);
}

.btn {
    padding: 15px 25px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(123, 46, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(123, 46, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-danger {
    background: linear-gradient(135deg, #FF2E88, #FF6042);
    color: white;
}

/* Contacts Grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.contact-card {
    background: var(--card-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
    animation: fadeIn 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Neon Racing Border Effect */
.contact-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: 28px;
    background: conic-gradient(from 0deg, 
        transparent 0%, 
        var(--accent-purple) 25%, 
        var(--accent-blue) 50%, 
        var(--accent-pink) 75%, 
        transparent 100%);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    0% { filter: hue-rotate(0deg); transform: rotate(0deg); }
    100% { filter: hue-rotate(360deg); transform: rotate(360deg); }
}

.contact-card:hover::before {
    opacity: 1;
}

.contact-card:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: transparent;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.6), 
        0 0 40px rgba(123, 46, 255, 0.15);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.contact-avatar {
    width: 64px;
    height: 64px;
    background: var(--primary-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 8px 16px rgba(123, 46, 255, 0.3);
}

.fav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.fav-btn.active {
    color: #FFD700;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

.contact-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.detail-row i {
    width: 16px;
    color: var(--accent-blue);
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-edit:hover {
    color: var(--accent-blue);
}

.btn-delete:hover {
    color: var(--accent-pink);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    width: 100%;
    max-width: 550px;
    padding: 40px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px 15px 12px 45px;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.toast {
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    border-radius: 16px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid #00f2fe; }
.toast.error { border-left: 4px solid #ff2e88; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }
    .main-content {
        max-width: 100%;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
