/* Mouse Latency Benchmark Specific Styles */
.latency-test-container {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    margin-bottom: 30px;
    min-height: 400px;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.latency-test-area {
    width: 100%;
    padding: 40px;
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 2;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.latency-test-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/tools/latency-grid.svg');
    background-size: cover;
    opacity: 0.1;
    z-index: -1;
}

.latency-test-area.active {
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
}

.latency-test-area.complete {
    background-color: rgba(0, 0, 0, 0.1);
}

.test-status {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.status-ready, .status-active, .status-complete {
    padding: 30px;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    color: #333;
}

.status-ready {
    text-align: center;
}

.status-ready i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #2a5298;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.status-ready h3 {
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.status-ready p {
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.status-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.target-container {
    position: relative;
    width: 100%;
    height: 300px;
    margin: 20px 0;
    border-radius: 8px;
    background-color: #f5f5f5;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.target {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #4CAF50, #2E7D32);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.7);
    cursor: pointer;
    transition: transform 0.1s ease;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.target:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.target::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.target::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.test-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e0e0e0;
}

.info-item {
    text-align: center;
    flex: 1;
}

.info-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.info-value {
    font-size: 24px;
    font-weight: 600;
}

.status-complete {
    text-align: center;
}

.result-header {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.result-stat {
    flex: 1;
    min-width: 120px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.result-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.result-value {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
}

.result-rating {
    margin: 25px 0;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.rating-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.rating-value {
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
}

.rating-value.excellent {
    color: #4cd137;
    text-shadow: 0 0 10px rgba(76, 209, 55, 0.7);
}

.rating-value.good {
    color: #fbc531;
    text-shadow: 0 0 10px rgba(251, 197, 49, 0.7);
}

.rating-value.average {
    color: #e84118;
    text-shadow: 0 0 10px rgba(232, 65, 24, 0.7);
}

.rating-value.poor {
    color: #c23616;
    text-shadow: 0 0 10px rgba(194, 54, 22, 0.7);
}

.latency-chart-container {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.chart-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-legend {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
}

.legend-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.latency-comparison {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.comparison-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
}

.comparison-table th, .comparison-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-table th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.comparison-table .highlight {
    background-color: rgba(255, 94, 98, 0.2);
}

.latency-tips {
    margin-top: 40px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.tip-icon {
    font-size: 36px;
    margin-bottom: 15px;
    color: #ff5e62;
    text-align: center;
}

.tip-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.tip-card p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

/* Advanced Settings Panel */
.advanced-settings {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
}

.settings-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.settings-toggle {
    font-size: 20px;
    color: #fff;
    transition: transform 0.3s ease;
}

.settings-toggle.active {
    transform: rotate(180deg);
}

.settings-content {
    display: none;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-content.visible {
    display: block;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.settings-input {
    width: 100%;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
}

.settings-input:focus {
    outline: none;
    border-color: rgba(255, 94, 98, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 94, 98, 0.2);
}

.settings-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    margin: 10px 0;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5e62;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 94, 98, 0.5);
}

.settings-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5e62;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 94, 98, 0.5);
    border: none;
}

.range-value {
    display: inline-block;
    width: 50px;
    text-align: center;
    font-size: 14px;
    color: #333333;
    margin-left: 10px;
}

.settings-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-reset {
    background-color: transparent;
    border: 1px solid #cccccc;
    color: #333333;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background-color: #2a5298;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.4);
    margin-top: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .latency-test-area {
        padding: 20px;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-stat {
        min-width: auto;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for target appearance */
@keyframes targetAppear {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.target.appear {
    animation: targetAppear 0.3s ease forwards;
}

/* Animation for successful click */
@keyframes targetHit {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

.target.hit {
    animation: targetHit 0.2s ease forwards;
}

/* Animation for the result display */
@keyframes resultAppear {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.status-complete {
    animation: resultAppear 0.5s ease forwards;
}

/* Glow effect for buttons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(30deg);
    transition: transform 0.6s;
    opacity: 0;
}

.btn:hover::after {
    transform: rotate(30deg) translate(100%, 100%);
    opacity: 1;
}

/* Particle effect for clicks */
.click-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    animation: particleAnimation 0.6s ease-out forwards;
}

@keyframes particleAnimation {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}
