/* Scoped to avoid conflicts */
#tcs-tester-wrapper {
    --primary-color: #0056b3;
    --secondary-color: #004494;
    --accent-color: #00a8ff;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333333;
    --success-color: #28a745;
    --error-color: #dc3545;
    --border-radius: 8px;

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    line-height: 1.6;
    max-width: 1000px;
    margin: 20px auto;
}
#tcs-tester-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }

/* Header */
#tcs-tester-wrapper header {
    background: #00a0e3;
    color: white;
    padding: 2rem 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,160,227, 0.3);
}
#tcs-tester-wrapper header h1 { font-size: 2rem; margin-bottom: 0.5rem; font-weight: 700; color: #ffffff; }
#tcs-tester-wrapper header p { font-size: 1.1rem; color: #ffffff; opacity: 1; font-weight: 500; }

/* Nav */
#tcs-tester-wrapper nav {
    display: flex; justify-content: center; gap: 0.8rem; padding: 1rem;
    flex-wrap: wrap; background: var(--card-bg); border-radius: var(--border-radius);
    margin-bottom: 1.5rem; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.nav-btn {
    background: white; border: 2px solid #00a0e3; color: #00a0e3;
    padding: 0.9rem 1.8rem; border-radius: var(--border-radius); cursor: pointer;
    font-size: 1.1rem; font-weight: 600; transition: all 0.2s;
}
.nav-btn:hover { background: #f0f8ff; transform: translateY(-2px); }
.nav-btn.active { background: #00a0e3; color: white; box-shadow: 0 4px 8px rgba(0,160,227,0.4); }

/* Sections */
.test-section { display: none; background: var(--card-bg); border-radius: var(--border-radius); padding: 2rem; animation: fadeIn 0.4s; }
.test-section.active { display: block; }
h2 { border-bottom: 2px solid var(--bg-color); padding-bottom: 0.5rem; margin-bottom: 1.5rem; color: var(--secondary-color); display: flex; justify-content: space-between; font-size: 1.5rem;}
.status-badge { font-size: 0.9rem; padding: 0.3rem 0.8rem; border-radius: 20px; background: #eee; color: #666; font-weight: bold;}

/* Keyboard */
.keyboard-container { text-align: center; }
.key-display { font-size: 3rem; font-weight: bold; color: var(--primary-color); height: 100px; display: flex; align-items: center; justify-content: center; background: #f8f9fa; border: 2px dashed #ccc; border-radius: var(--border-radius); margin-bottom: 1rem; }
.key-history { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; min-height: 50px; padding: 1rem; background: #f8f9fa; border-radius: var(--border-radius); }
.history-key { background: white; border: 1px solid #ddd; padding: 0.3rem 0.6rem; border-radius: 4px; animation: popIn 0.2s ease; }

/* Mouse */
.mouse-test-area { background: #f8f9fa; border: 2px dashed #ccc; border-radius: var(--border-radius); height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; cursor: crosshair; }
.mouse-instruction { text-align: center; pointer-events: none; margin-bottom: 20px; color: #666; font-size: 1.1rem; }
.click-indicator { width: 70px; height: 70px; border-radius: 50%; background: #ddd; color: #555; display: flex; align-items: center; justify-content: center; font-weight: bold; margin: 15px; transition: all 0.1s; font-size: 1.2rem; }
.click-indicator.active { background: var(--success-color); color: white; transform: scale(1.15); }
.scroll-indicator { margin-top: 20px; text-align: center; width: 80%; font-weight: 600; }
.scroll-track { width: 100%; height: 12px; background: #ddd; border-radius: 6px; margin-top: 5px; overflow: hidden; }
.scroll-bar { height: 100%; width: 0%; background: var(--accent-color); }

/* System Info */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.info-card { background: #f8f9fa; padding: 1.2rem; border-radius: 6px; border: 1px solid #eee; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.info-card strong { display: block; color: #00a0e3; font-size: 0.9rem; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px;}
.info-card span { font-size: 1.2rem; font-weight: 600; }
.screen-colors { display: flex; height: 80px; border-radius: var(--border-radius); overflow: hidden; border: 2px solid #ddd; }
.color-box { flex: 1; }
.color-box.red { background: #ff4d4d; } .color-box.green { background: #2ecc71; } .color-box.blue { background: #3498db; } .color-box.white { background: #ffffff; } .color-box.black { background: #000000; }

/* Webcam */
.video-wrapper { width: 100%; max-width: 640px; margin: 0 auto; background: #000; border-radius: var(--border-radius); overflow: hidden; aspect-ratio: 4/3; }
video { width: 100%; height: 100%; object-fit: cover; }
.cam-info { margin-top: 1rem; text-align: center; font-family: monospace; background: #eee; padding: 0.8rem; border-radius: 4px; font-size: 1.1rem; font-weight: bold;}

/* Audio/Mic */
canvas { display: block; width: 100%; height: 220px; background: #222; border-radius: var(--border-radius); margin-bottom: 1rem; box-shadow: inset 0 0 20px rgba(0,0,0,0.5); }
.controls { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }

/* Action Buttons */
.action-btn { background: var(--success-color); color: white; border: none; padding: 1rem 2.5rem; border-radius: var(--border-radius); cursor: pointer; font-size: 1.2rem; font-weight: 600; box-shadow: 0 4px 6px rgba(0,0,0,0.2); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.2s;}
.action-btn:hover { transform: translateY(-2px); }
.action-btn.stop { background: var(--error-color); }
.action-btn.stop:hover { background: #c82333; }
.action-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none;}

/* Report Actions Section */
.report-actions {
    background: linear-gradient(to bottom, #ffffff, #f9f9f9); padding: 2rem; border-radius: var(--border-radius);
    margin-top: 2rem; border-top: 4px solid #00a0e3; text-align: center; box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
}
.report-actions h3 { margin-bottom: 1.5rem; color: var(--secondary-color); font-size: 1.8rem; }
.actions-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.report-btn { background: #333; }
.whatsapp-btn { background: #25D366; }
.repair-btn { background: #ff6b6b; color: #ffffff !important; }
.repair-btn:hover { background: #ee5253; }

/* IMPROVED & ATTRACTIVE Customer Details Section */
.user-details-section {
    background: linear-gradient(135deg, #ffffff, #f8fbff); /* Subtle Gradient */
    padding: 2.5rem 2rem;
    border-radius: 16px; /* Softer corners */
    margin-top: 2rem;
    border: 1px solid rgba(0, 160, 227, 0.2); /* Subtle border */
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Deep shadow */
    position: relative;
    overflow: hidden;
}

/* Decorative header for form */
.user-details-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 6px;
    background: linear-gradient(90deg, #0056b3, #00a0e3);
}

.section-header {
    text-align: center; margin-bottom: 2rem;
}
.section-header h3 { 
    font-size: 1.8rem; 
    color: #003366; /* Darker blue for text */
    margin-bottom: 0.5rem; 
    font-weight: 700;
}
.section-header p { 
    color: #667788; 
    font-size: 0.95rem; 
    font-weight: 500; 
}

.form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 2rem; /* Wider gap for elegance */
}

.input-group { 
    position: relative;
    display: flex; 
    flex-direction: column; 
}

.input-group label { 
    margin-bottom: 0.6rem; 
    font-weight: 700; 
    color: #444; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    margin-left: 4px;
}

.input-group input {
    width: 100%; 
    padding: 1.1rem 1rem; 
    border: 2px solid #e0e6ed; /* Lighter border */
    border-radius: 10px; /* Rounded inputs */
    font-size: 1.05rem; 
    background-color: #ffffff;
    color: #333;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

/* Attractive Focus State */
.input-group input:focus {
    border-color: #00a0e3;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 160, 227, 0.15); /* Glowing ring */
    transform: translateY(-2px); /* Slight lift */
}

.input-group input::placeholder {
    color: #aaa;
    font-weight: 400;
}

/* Network */
.network-dashboard { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.5rem; }
.net-card { background: #f8f9fa; padding: 2rem; border-radius: 8px; border: 1px solid #ddd; flex: 1; min-width: 180px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.net-card h3 { font-size: 1rem; color: #666; margin-bottom: 0.5rem; font-weight: normal; }
.net-card p { font-size: 1.5rem; font-weight: bold; color: #00a0e3; }

/* Battery */
#battery-container { display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.battery-wrapper { display: flex; align-items: center; }
.battery-body { width: 220px; height: 90px; border: 5px solid #333; border-radius: 12px; padding: 5px; position: relative; background: white; }
.battery-tip { width: 20px; height: 50px; background: #333; margin-left: -2px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.battery-level { height: 100%; background: var(--success-color); width: 0%; border-radius: 6px; transition: width 0.5s; }
.battery-info { text-align: center; }
.battery-info h3 { font-size: 3rem; color: #00a0e3; font-weight: 700; }
.battery-info p { font-size: 1.2rem; color: #555; font-weight: 600;}

footer { text-align: center; padding: 2rem; color: #666; font-size: 0.9rem; border-top: 1px solid #eee; margin-top: 2rem;}
.toast { position: fixed; bottom: 20px; right: 20px; background: #333; color: white; padding: 15px 30px; border-radius: 8px; opacity: 0; transform: translateY(20px); transition: 0.3s; z-index: 99999; font-size: 1rem; font-weight: 500; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 600px) {
    #tcs-tester-wrapper nav { flex-direction: column; }
    .nav-btn { width: 100%; padding: 1rem; font-size: 1rem; }
    .action-btn { width: 100%; justify-content: center; }
    .actions-row { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; gap: 1rem; }
}