:root {
    --primary: #E11D48;
    --primary-hover: #BE123C;
    --secondary: #4F46E5;
    --dark: #1E293B;
    --light: #F8FAFC;
    --text-main: #334155;
    --text-muted: #64748B;
    --bg-main: #F1F5F9;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --glass-bg: rgba(255, 255, 255, 0.90);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --input-bg: #FFFFFF;
    --footer-bg: #FFFFFF;
    --footer-text: #475569;
}

[data-theme="dark"] {
    --primary: #F43F5E;
    --primary-hover: #E11D48;
    --dark: #F8FAFC;
    --light: #0f172a;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --bg-main: #0B1120;
    --white: #1E293B;
    --border: #334155;
    --glass-bg: rgba(30, 41, 59, 0.85);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --input-bg: #0f172a;
    --footer-bg: #040812;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg-main); color: var(--text-main); line-height: 1.6; transition: background 0.3s ease, color 0.3s ease; }
html { scroll-behavior: smooth; }

/* Typography */
h1, h2, h3, h4 { color: var(--dark); font-weight: 700; transition: color 0.3s ease; }
a { text-decoration: none; color: var(--primary); transition: 0.3s; }
a:hover { color: var(--primary-hover); }

/* Layouts */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main-content { padding-top: 100px; min-height: 80vh; }
.ad-container { margin: 2rem auto; max-width: 100%; text-align: center; overflow: hidden; display: block; min-height: 90px; background: rgba(0,0,0,0.02); }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 1rem; } .gap-4 { gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.p-4 { padding: 1.5rem !important; }
.flex-1 { flex: 1; }

/* Logo Theme Toggling */
.logo-light, .logo-default { display: block; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
[data-theme="dark"] .logo-default { display: block; filter: brightness(0) invert(1); }

/* Buttons */
.btn { display: inline-block; padding: 0.6rem 1.2rem; border-radius: 8px; font-weight: 500; cursor: pointer; transition: 0.3s; border: none; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-pill { border-radius: 50px; padding: 0.2rem 0.6rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; color: var(--dark); font-size: 0.9rem; transition: color 0.3s ease;}
.form-group input, .form-group select, .form-group textarea, .form-control { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; outline: none; transition: 0.3s; background: var(--input-bg); color: var(--text-main); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1); }
.full-width { grid-column: 1 / -1; }

/* Glass Panel - Ultra Premium */
.glass-panel { background: var(--glass-bg); backdrop-filter: blur(20px); border-radius: 20px; padding: 2rem; border: 1px solid var(--border); box-shadow: var(--glass-shadow); }
.p-0 { padding: 0 !important; }

/* Capsule Header Navbar */
.header-wrapper { position: fixed; top: 15px; left: 0; right: 0; z-index: 1000; padding: 0 15px; }
.capsule-header { background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 50px; max-width: 1200px; margin: 0 auto; box-shadow: var(--glass-shadow); transition: all 0.3s ease; }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 75px; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-main); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.nav-links .btn { color: var(--primary); font-weight: 600; }
.nav-links .btn-primary { color: #fff; }
.theme-toggle-btn { background: var(--bg-main); border: 1px solid var(--border); width: 42px; height: 42px; border-radius: 50%; color: var(--text-main); font-size: 1.1rem; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: 0.3s; margin-left: 5px; }
.theme-toggle-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--dark); }

/* Floating Theme Toggle */
.theme-toggle-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 9999;
}
.theme-toggle-floating:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(225,29,72,0.3);
}

/* User Nav Pill */
.user-nav-pill { display: flex; align-items: center; gap: 1rem; background: rgba(225, 29, 72, 0.08); padding: 5px 15px; border-radius: 50px; border: 1px solid rgba(225, 29, 72, 0.15); box-shadow: inset 0 2px 5px rgba(0,0,0,0.02); }
[data-theme="dark"] .user-nav-pill { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.2); }
.user-nav-pill a { color: var(--primary) !important; font-weight: 600 !important; display: flex; align-items: center; gap: 6px; padding: 5px 0; }
.user-nav-pill a:hover { color: var(--primary-hover) !important; transform: translateY(-1px); }
.user-nav-pill a i { opacity: 0.8; font-size: 0.9em; }
.user-nav-divider { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); opacity: 0.3; }

/* Hero Section */
.hero-section { background: linear-gradient(rgba(30,41,59,0.7), rgba(30,41,59,0.7)), url('https://images.unsplash.com/photo-1511285560929-80b456fea0bc?auto=format&fit=crop&q=80') center/cover; padding: 100px 0; text-align: center; color: var(--white); }
.hero-content h1 { font-size: 3.5rem; color: var(--white); margin-bottom: 1rem; }
.hero-content p { font-size: 1.25rem; margin-bottom: 2.5rem; opacity: 0.9; }

/* Search Box */
.search-box { background: var(--white); padding: 1.5rem; border-radius: 16px; display: inline-block; max-width: 900px; width: 100%; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.search-form { display: flex; gap: 1rem; align-items: center; text-align: left; }
.search-input { flex: 1; }
.search-input label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.search-input input, .search-input select { width: 100%; border: none; border-bottom: 2px solid var(--border); padding: 0.5rem 0; border-radius: 0; background: transparent; font-weight: 500; font-size: 1rem; color: var(--dark); }
.search-input input:focus, .search-input select:focus { outline: none; border-bottom-color: var(--primary); }
.search-form .btn { padding: 1rem 2rem; white-space: nowrap; height: 100%; display: flex; align-items: center; gap: 0.5rem; }
.age-range { display: flex; align-items: center; gap: 0.5rem; }
.age-range input { width: 60px; text-align: center; }

/* Profiles */
.profiles-section { padding: 4rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.profiles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.5rem; }
.profile-card { overflow: hidden; transition: 0.3s; position: relative; border-radius: 12px; }
.profile-card:hover { transform: translateY(-5px); box-shadow: 0 16px 30px rgba(0,0,0,0.1); }
.profile-card.featured { border: 2px solid var(--warning); }
.image-wrapper { height: 230px; overflow: hidden; position: relative; border-radius: 12px 12px 0 0; }
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.profile-card:hover .image-wrapper img { transform: scale(1.08); }
.featured-badge { position: absolute; top: 0.8rem; left: 0.8rem; background: var(--warning); color: #fff; padding: 0.3rem 0.6rem; border-radius: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); font-size: 0.75rem; font-weight: bold; z-index: 2; }
.profile-info { padding: 1.2rem; }
.profile-name { font-size: 1.15rem; margin-bottom: 0.8rem; font-weight: 800; color: var(--dark); }
.profile-meta { list-style: none; margin-bottom: 1.2rem; }
.profile-meta li { margin-bottom: 0.4rem; font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }

/* Profile Detail */
.profile-detail-container { padding: 2rem 0; }
.profile-header { display: flex; gap: 2rem; padding: 2rem; margin-bottom: 2rem; align-items: center; }
.profile-header-images { width: 300px; }
.main-profile-img { width: 100%; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.image-gallery { display: flex; gap: 0.5rem; margin-top: 0.5rem; overflow-x: auto; }
.gallery-img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.gallery-img:hover { opacity: 0.8; }
.profile-header-info h1 { font-size: 2.5rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 1rem; }
.profile-meta-main { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.profile-actions { display: flex; gap: 1rem; }
.profile-section { padding: 2rem; height: 100%; }
.detail-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.detail-table th, .detail-table td { padding: 1rem 0; border-bottom: 1px solid var(--border); text-align: left; }
.detail-table th { color: var(--text-muted); font-weight: 500; width: 40%; }
.detail-table td { font-weight: 600; color: var(--dark); }

/* Dashboard & Admin */
.grid-sidebar { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; padding: 2rem 0; min-height: calc(100vh - 70px - 200px); }
.sidebar-user { text-align: center; padding: 2rem 1rem; border-bottom: 1px solid var(--border); }
.sidebar-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 1rem; border: 3px solid var(--primary); }
.sidebar-nav { padding: 0.5rem 0; display: flex; flex-direction: column; }
.sidebar-nav a { padding: 1rem 1.5rem; color: var(--text-main); font-weight: 600; font-size: 1.05rem; border-radius: 12px; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 1rem; transition: 0.3s; border: 1px solid transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff; box-shadow: 0 8px 15px rgba(225,29,72,0.3); border-color: var(--primary-hover); transform: translateX(5px); }
.sidebar-nav a i { width: 24px; text-align: center; }
.dashboard-main h2 { margin-bottom: 1.5rem; border-bottom: 2px solid var(--primary); display: inline-block; padding-bottom: 0.5rem; }

/* Floating Premium Admin Layout */
.admin-layout-active .container.grid-sidebar { max-width: 98%; padding: 1.5rem; margin: 0 auto; }
.admin-layout-active .grid-sidebar { gap: 1.5rem; }
.admin-layout-active .dashboard-sidebar { 
    border-radius: 20px; 
    border: 1px solid var(--border); 
    height: calc(100vh - 3rem) !important; 
    top: 1.5rem !important; 
    padding: 1.5rem; 
    box-shadow: var(--glass-shadow); 
}
.admin-layout-active .dashboard-main { padding: 0; min-height: calc(100vh - 3rem); }
.admin-layout-active .sidebar-nav a { padding: 0.6rem 1rem; margin-bottom: 0.25rem; font-size: 0.9rem; border-radius: 10px; }
@media (max-width: 991px) {
    .admin-layout-active .dashboard-sidebar { height: auto !important; position: relative !important; top: 0 !important; margin-bottom: 1.5rem; }
    .admin-layout-active .container.grid-sidebar { padding: 1rem; }
}

/* Lists & Tables */
.list-group { display: flex; flex-direction: column; gap: 1rem; }
.list-item { padding: 1rem; border: 1px solid var(--border); border-radius: 8px; transition: 0.3s; }
.list-item:hover { border-color: var(--primary); background: #fff; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: rgba(0,0,0,0.03); font-weight: 600; color: var(--text-main); }
[data-theme="dark"] .table th { background: rgba(255,255,255,0.05); }
.table-responsive { overflow-x: auto; }

/* Chat */
.chat-container { display: flex; flex-direction: column; height: 600px; }
.chat-header { padding: 1rem; border-bottom: 1px solid var(--border); }
.avatar-sm { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; background: rgba(255,255,255,0.5); }
.message { max-width: 70%; display: flex; flex-direction: column; }
.message.sent { align-self: flex-end; align-items: flex-end; }
.message.received { align-self: flex-start; align-items: flex-start; }
.msg-bubble { padding: 0.8rem 1.2rem; border-radius: 16px; font-size: 0.95rem; }
.message.sent .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.message.received .msg-bubble { background: #fff; color: var(--dark); border-bottom-left-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid var(--border); }
.msg-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.chat-input-area { padding: 1rem; border-top: 1px solid var(--border); background: #fff; border-radius: 0 0 12px 12px; }

/* Auth */
.auth-container { display: flex; justify-content: center; align-items: center; padding: 4rem 2rem; min-height: 80vh; }
.auth-card { width: 100%; max-width: 450px; padding: 2.5rem; border-radius: 16px; text-align: center; }
.auth-header { margin-bottom: 2rem; }
.auth-header h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.auth-header p { color: var(--text-muted); }
.auth-form { text-align: left; }
.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; font-size: 0.9rem; }
.auth-footer { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.5rem; color: var(--text-muted); }

/* Footer */
.footer { background: var(--footer-bg); color: var(--footer-text); padding: 2.5rem 0 1.5rem; margin-top: 1.5rem; border-radius: 24px 24px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,0.03); transition: background 0.3s ease; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4rem; margin-bottom: 3rem; }
.footer-col h3 { color: var(--dark); margin-bottom: 1.5rem; font-size: 1.25rem; font-weight: 700; transition: color 0.3s; }
.footer-col a { display: block; color: var(--footer-text); margin-bottom: 0.8rem; font-weight: 500; transition: 0.3s; }
.footer-col a:hover { color: var(--primary); padding-left: 5px; }
.footer-col p { margin-bottom: 0.8rem; font-size: 0.95rem; line-height: 1.7; }
.footer-bottom { text-align: center; border-top: 1px solid var(--border); padding-top: 2rem; font-size: 0.9rem; font-weight: 500; }
.social-links { display: flex; gap: 15px; margin-top: 15px; font-size: 1.1rem; }
.social-links a { display: inline-flex; width: 42px; height: 42px; background: rgba(128,128,128,0.1); border-radius: 50%; align-items: center; justify-content: center; transition: 0.3s; color: var(--footer-text); margin-bottom: 0; }
.social-links a:hover { background: var(--primary); color: #fff; transform: translateY(-4px); box-shadow: 0 8px 15px rgba(225,29,72,0.3); padding-left: 0; }

/* Responsive */
@media (max-width: 991px) {
    .grid-sidebar { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2.5rem; }
    .search-form { flex-direction: column; }
    .search-form .btn { width: 100%; }
}

@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 70px; left: 0; width: 100%; background: var(--white); flex-direction: column; padding: 1rem 0; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: block; }
    .grid-2, .grid-3, .grid-4, .footer-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; text-align: center; }
    
    .user-nav-pill { flex-direction: column; border-radius: 12px; align-items: stretch; padding: 10px 15px; background: rgba(225, 29, 72, 0.03); border: none; margin: 0 20px; box-shadow: none; }
    .user-nav-divider { display: none; }
}
