:root {
    --primary: #cb11ab;
    --primary-light: #e529c4;
    --secondary: #242424;
    --like: #4CAF50;
    --dislike: #f44336;
    --bg: #0f0f0f;
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --text-dark: #1a1a1a;
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: 'Inter', sans-serif; 
    background: radial-gradient(circle at top right, #300a2a, #0f0f0f);
    color: var(--text);
    height: 100dvh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

#app { width: 100%; max-width: 480px; height: 100%; position: relative; }

.container { height: 100%; display: flex; flex-direction: column; }

/* Header */
.glass-header { 
    padding: 15px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.logo { font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.logo span { color: var(--primary); }

.header-btns { display: flex; gap: 12px; }
.icon-btn { 
    background: rgba(255,255,255,0.1); 
    border: none; 
    color: white; 
    width: 40px; 
    height: 40px; 
    border-radius: 12px; 
    font-size: 18px; 
    cursor: pointer; 
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover { background: var(--primary); transform: translateY(-2px); }
.liked-btn i { color: #ff4b4b; }

/* Tinder Cards Container */
.tinder-container { 
    flex: 1; 
    position: relative; 
    padding: 15px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    perspective: 1000px;
}

.tinder-cards { width: 100%; height: 100%; position: relative; max-height: 650px; }

/* Tinder Card */
.tinder-card { 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    background: var(--card-bg); 
    border-radius: 24px; 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    cursor: grab; 
    user-select: none; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.1s ease-out, opacity 0.3s; 
    opacity: 0; 
    pointer-events: none;
    transform-origin: center bottom;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1;
}

.tinder-card.visible { opacity: 1; pointer-events: auto; }

.tinder-card img { 
    width: 100%; 
    height: 65%; 
    object-fit: contain; 
    background: #fff; 
    pointer-events: none;
    border-bottom: 1px solid #f0f0f0;
}

.card-info { 
    padding: 15px 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
    flex-grow: 1; 
    color: var(--text-dark); 
    background: linear-gradient(to bottom, #ffffff, #f9f9f9);
    overflow: hidden;
}
.card-info .brand { font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }
.card-info .price { font-size: 28px; font-weight: 800; color: #000; }
.card-info .name { font-size: 15px; color: #444; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card-link { 
    display: block;
    text-align: center; 
    padding: 15px; 
    background: #f0f0f0; 
    text-decoration: none; 
    color: var(--primary); 
    font-weight: 800; 
    font-size: 14px; 
    border-top: 1px solid #eee;
    transition: all 0.2s;
    z-index: 10;
    position: relative;
}
.card-link:hover { background: var(--primary); color: white; }

/* Overlays */
.swipe-overlay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.1s ease-out, transform 0.1s ease-out;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.like-overlay { background: rgba(76, 175, 80, 0.9); border: 4px solid white; }
.dislike-overlay { background: rgba(244, 67, 54, 0.9); border: 4px solid white; }

/* Action Buttons */
.tinder-buttons { padding: 20px; display: flex; justify-content: center; gap: 20px; z-index: 100; }
.action-btn { 
    width: 65px; 
    height: 65px; 
    border-radius: 50%; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.3); 
    background: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.action-btn:active { transform: scale(0.9); }
.btn-dislike { color: var(--dislike); border: 2px solid #fff; }
.btn-like { color: var(--like); border: 2px solid #fff; }
.btn-like:hover { background: var(--like); color: white; transform: scale(1.1); }
.btn-dislike:hover { background: var(--dislike); color: white; transform: scale(1.1); }

/* Modals */
.modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); 
    z-index: 1000; 
    display: flex; justify-content: center; align-items: center; 
    padding: 20px; 
    backdrop-filter: blur(10px); 
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.glass-card { 
    background: rgba(255, 255, 255, 0.95); 
    width: 100%; max-width: 400px; 
    border-radius: 30px; 
    padding: 30px; 
    position: relative; 
    max-height: 85vh; 
    overflow-y: auto; 
    color: var(--text-dark);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.close-modal { position: absolute; top: 20px; right: 25px; font-size: 30px; cursor: pointer; color: #ccc; transition: color 0.2s; }
.close-modal:hover { color: var(--primary); }

/* Auth Styling */
.tabs { display: flex; margin: 25px 0; background: #eee; border-radius: 15px; padding: 5px; }
.tab-btn { flex: 1; padding: 12px; border: none; background: none; cursor: pointer; font-size: 15px; font-weight: 600; color: #666; border-radius: 12px; transition: all 0.2s; }
.tab-btn.active { background: white; color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.input-group { position: relative; margin-bottom: 15px; }
.input-group i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #aaa; }
.input-group input { width: 100%; padding: 14px 15px 14px 45px; border: 1.5px solid #eee; border-radius: 15px; font-size: 16px; transition: border-color 0.2s; outline: none; }
.input-group input:focus { border-color: var(--primary); }

.submit-btn { width: 100%; background: var(--primary); color: white; border: none; padding: 16px; border-radius: 15px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 10px; transition: background 0.2s; }
.submit-btn:hover { background: var(--primary-light); }

.limit-warning { margin-top: 20px; padding: 15px; background: #fff5f5; border-radius: 15px; color: var(--dislike); font-size: 14px; text-align: center; border: 1px solid #ffe3e3; line-height: 1.5; }

/* Onboarding */
.onboarding-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 25px 0;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}
.interest-item {
    background: #f5f5f5;
    border: 2px solid transparent;
    padding: 12px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    user-select: none;
    color: var(--secondary);
}
.interest-item.selected {
    background: rgba(203, 17, 171, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}
.onboarding-card p {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.search-box {
    position: relative;
    margin: 20px 0 10px 0;
}
.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border-radius: 12px;
    border: 1.5px solid #eee;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}
.search-box input:focus {
    border-color: var(--primary);
}
.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.onboarding-card h2 {
    text-align: center;
}

/* Liked List */
.liked-list { display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 20px; }
.liked-item { display: flex; gap: 15px; padding: 12px; background: #f9f9f9; border-radius: 18px; border: 1px solid #eee; transition: transform 0.2s; }
.liked-item:hover { transform: scale(1.02); }
.liked-item img { width: 70px; height: 90px; object-fit: contain; border-radius: 10px; background: white; }
.liked-item-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.liked-item-name { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 5px; }
.liked-item-price { font-weight: 800; color: var(--primary); font-size: 16px; }
.liked-item-link { font-size: 12px; color: var(--secondary); text-decoration: none; margin-top: 8px; font-weight: 600; }

/* Admin Panel Styling */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 20px 0; }
.stat-item { background: linear-gradient(135deg, var(--primary), var(--primary-light)); padding: 20px; border-radius: 20px; text-align: center; color: white; }
.stat-value { font-size: 24px; font-weight: 800; display: block; }
.stat-label { font-size: 12px; opacity: 0.9; font-weight: 600; }

.admin-control-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: #f0f7ff; border-radius: 15px; margin-bottom: 20px; font-weight: 600; }

.admin-sections { display: flex; flex-direction: column; gap: 20px; }
.admin-section h3 { font-size: 16px; margin-bottom: 12px; color: #333; }
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

#admin-categories-list { list-style: none; max-height: 150px; overflow-y: auto; background: #f9f9f9; border-radius: 15px; padding: 10px; }
#admin-categories-list li { padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; font-size: 14px; }

.logs-view { background: #1e1e1e; color: #00ff41; padding: 15px; border-radius: 15px; font-family: 'Consolas', monospace; font-size: 11px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; }

/* Loader */
.loader { text-align: center; }
.spinner { width: 50px; height: 50px; border: 5px solid rgba(255,255,255,0.1); border-top: 5px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Swipe Animations */
.swiping-left { transform: translateX(-200%) rotate(-45deg) !important; opacity: 0 !important; transition: all 0.6s ease-in !important; }
.swiping-right { transform: translateX(200%) rotate(45deg) !important; opacity: 0 !important; transition: all 0.6s ease-in !important; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }
