:root {
    --primary-color: #dc143c;
    --primary-glow: rgba(220, 20, 60, 0.6);
    --bg-dark: #09090b;
    --glass-bg: rgba(18, 18, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-light: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Master Animation Override */
body.no-anim * {
    animation: none !important;
    transition: none !important;
}

.text-red { color: var(--primary-color); }
.glow-text { text-shadow: 0 0 15px var(--primary-glow); margin: 0; font-weight: 800; letter-spacing: 2px;}
.sub-text { color: #888; font-size: 0.85rem; margin-bottom: 20px;}
.contact-link { text-decoration: none; font-weight: bold; transition: 0.3s; }
.contact-link:hover { text-shadow: 0 0 10px var(--primary-glow); }

.glass-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    margin-bottom: 15px;
    transition: border 0.3s, box-shadow 0.3s;
}
.glass-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 10px var(--primary-glow); }

.btn-red {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    display: block; 
    text-align: center;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.glow-btn:hover { box-shadow: 0 0 20px var(--primary-glow); transform: translateY(-2px) scale(1.02); }
.glow-btn:active { transform: scale(0.95); } 

.result-area { width: 100%; margin-top: 15px; }
.result-area audio { width: 100%; margin-bottom: 15px; border-radius: 5px; }

/* Modal Popups */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 2500;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal-content {
    width: 90%; max-width: 420px;
    background: var(--glass-bg); padding: 35px;
    border: 1px solid var(--primary-color); border-radius: 12px;
    box-shadow: 0 0 40px rgba(220,20,60,0.3);
    text-align: left;
}
.cb-container { display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.cb-container label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: #ddd; transition: 0.2s;}
.cb-container label:hover { color: #fff; transform: translateX(5px); }

#loginOverlay {
    position: absolute; z-index: 999;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    padding: 40px; border-radius: 12px; text-align: center; width: 320px;
}
.error-msg { color: var(--primary-color); font-size: 0.8rem; height: 15px; margin-top: 10px; transition: color 0.3s; font-weight: bold;}
.version-tag { color: #555; font-size: 0.8rem; margin-top: 15px; font-weight: bold; }
.version-tag-top { color: #777; font-size: 0.9rem; font-weight: bold; letter-spacing: 1px;}

#appContainer { width: 100%; height: 100%; display: flex; flex-direction: column; }

.top-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 60px;
    background: rgba(9, 9, 11, 0.95); border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 200;
}
.top-bar-left, .top-bar-right { display: flex; align-items: center; gap: 20px; }

.menu-btn { width: 30px; height: 24px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; z-index: 201; }
.menu-line { width: 100%; height: 3px; background-color: var(--text-light); transition: 0.3s; border-radius: 2px; }
.menu-btn.open .menu-line:nth-child(1) { transform: rotate(-45deg) translate(-7px, 7px); }
.menu-btn.open .menu-line:nth-child(2) { opacity: 0; }
.menu-btn.open .menu-line:nth-child(3) { transform: rotate(45deg) translate(-7px, -8px); }

.status-indicator { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, 0.5); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--glass-border); font-size: 0.85rem; font-weight: bold; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background-color: #555; box-shadow: 0 0 8px #555; transition: 0.3s; }
.status-dot.online { background-color: #00ff00; box-shadow: 0 0 10px #00ff00; }

.sidebar {
    width: 250px; height: calc(100% - 60px); top: 60px;
    background: var(--glass-bg); border-left: 1px solid var(--glass-border);
    position: fixed; right: -260px; transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 150;
}
.sidebar.open { right: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--glass-border); }
.nav-links { list-style: none; padding: 0; margin: 0; }
.nav-links li { padding: 20px; cursor: pointer; border-bottom: 1px solid var(--glass-border); transition: 0.2s; font-weight: bold; }
.nav-links li:hover, .nav-links li.active { background: rgba(220, 20, 60, 0.2); color: var(--primary-color); border-right: 4px solid var(--primary-color); padding-left: 25px; }

#contentArea { flex-grow: 1; padding: 30px; margin-top: 60px; overflow-y: auto; width: 100%; position: relative; }

.app-view { display: none; max-width: 900px; margin: 0 auto; position: relative;}
.app-view.active-view { display: block; animation: viewEnter 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.dashboard-grid, .converter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.dash-card { background: rgba(20, 20, 25, 0.6); border: 1px solid var(--glass-border); padding: 20px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); animation: slideUp 0.6s ease backwards;}
.dash-card:nth-child(1) { animation-delay: 0.1s; }
.dash-card:nth-child(2) { animation-delay: 0.2s; }
.dash-card h3 { margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px;}

.snap-settings { display: flex; align-items: center; margin-bottom: 10px; font-size: 0.85rem; color: #aaa; }
.snap-select { width: auto; padding: 6px; margin-left: 8px; margin-bottom: 0; font-size: 0.8rem; }
.editor-container { background: #050505; border: 2px solid #222; border-radius: 8px; margin-bottom: 20px; position: relative; padding: 10px; padding-bottom: 25px; }
canvas { background: #111; cursor: crosshair; border-radius: 4px; width: 100%; border: 1px solid #333;}
.axis-labels { position: absolute; top: 10px; left: -60px; height: 200px; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.75rem; color: #666; }
.placeholder-box { text-align: center; border: 2px dashed #444; padding: 50px 20px; border-radius: 8px; background: rgba(0,0,0,0.3); margin-bottom: 20px;}

/* --- TABLE LINE FIXES --- */
.admin-table-container { 
    background: rgba(0, 0, 0, 0.4); 
    border: 1px solid var(--glass-border); 
    border-radius: 8px; 
    overflow: hidden; 
    overflow-x: auto;
}
.admin-table { 
    width: 100%; 
    border-collapse: collapse; 
    text-align: left; 
}
.admin-table tr { 
    border-bottom: 1px solid var(--glass-border); /* Move border to the Row */
    transition: background 0.2s; 
}
.admin-table tr:last-child {
    border-bottom: none;
}
.admin-table th, .admin-table td { 
    padding: 12px 15px; 
    vertical-align: middle; 
    border: none; /* Remove buggy cell borders */
}
.admin-table tr:hover { background: rgba(255,255,255,0.08); }

.action-btns-wrapper { display: flex; gap: 5px; }
.admin-table td:first-child { transition: padding-left 0.2s ease, border-left 0.2s ease; border-left: 3px solid transparent; }
.admin-table tr:hover td:first-child { padding-left: 22px; border-left: 3px solid var(--primary-color); }
.admin-table th { background: rgba(220, 20, 60, 0.1); color: var(--primary-color); }

.btn-small { background: #555; color: white; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; transition: 0.2s; }
.btn-small:hover { background: var(--primary-color); transform: scale(1.05); }
.btn-small:active { transform: scale(0.9); }
.admin-header-flex { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px;}
.ip-text { font-size: 0.75rem; color: #aaa; display: block; }
.device-text { font-size: 0.75rem; color: #777; display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.online-dot { display:inline-block; width:8px; height:8px; background:#00ff00; border-radius:50%; margin-right:5px; box-shadow: 0 0 5px #00ff00;}
.offline-dot { display:inline-block; width:8px; height:8px; background:#555; border-radius:50%; margin-right:5px;}

.app-logo { width: 65px; height: 65px; margin-bottom: 15px; filter: drop-shadow(0 0 10px var(--primary-glow)); }
.header-brand { display: flex; align-items: center; gap: 10px; }
.hidden { display: none !important; }

.ui-notification { position: fixed; bottom: 30px; right: -300px; background: var(--glass-bg); border-left: 4px solid var(--primary-color); padding: 15px 25px; border-radius: 4px; box-shadow: 0 5px 15px rgba(0,0,0,0.8); z-index: 3000; transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); font-weight: bold; }
.ui-notification.show { right: 30px; }

.blocked-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; background: rgba(10,10,10,0.9); border: 1px solid var(--primary-color); padding: 40px; border-radius: 10px; box-shadow: 0 0 30px rgba(220, 20, 60, 0.4); z-index: 50; width: 80%; max-width: 400px; }
.blocked-overlay h1 { margin-top: 0; }

/* --- KEYFRAME ANIMATIONS --- */
.pop-in { animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.slide-down { animation: slideDown 0.4s ease-out forwards; }
.fade-in { animation: fadeIn 0.4s ease forwards; }

@keyframes popIn { 0% { opacity: 0; transform: scale(0.7); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slideDown { 0% { opacity: 0; transform: translateY(-50px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { 0% { opacity:0; transform: translateY(30px); } 100% { opacity:1; transform: translateY(0); } }
@keyframes viewEnter { 0% { opacity: 0; transform: translateY(15px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }