/* Tools CSS - Styles for all interactive tools */

/* Tool Section Layout */
.tool-section {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.tool-description {
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.tool-description h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 28px;
}

.tool-description p, .tool-description ul {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.tool-description ul {
    margin: 15px 0;
    padding-left: 20px;
}

.tool-description li {
    margin-bottom: 40px;
}

.tool-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid #e9ecef;
    padding: 30px;
}

.tool-header {
    text-align: center;
    margin-bottom: 25px;
}

.tool-header h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.tool-header p {
    color: #666;
    font-size: 16px;
}

/* Tool Controls */
.tool-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 16px;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #f1f1f1;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e1e1e1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.test-duration {
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-duration label {
    font-weight: 500;
    color: #555;
}

.test-duration select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-size: 14px;
}

/* Test Area Styles */
.test-area {
    width: 100%;
    height: 300px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    background-color: #fafafa;
}

.test-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #888;
}

.test-instructions i {
    margin-bottom: 15px;
    color: #4CAF50;
}

.test-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
}

.progress-bar {
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #555;
}

.test-results {
    display: none;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 250px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.result-label {
    font-weight: 500;
    color: #555;
}

.result-value {
    font-weight: 700;
    color: #333;
}

/* Data Visualization */
.data-visualization {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    height: 300px;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

/* Result Interpretation */
.result-interpretation {
    margin-top: 30px;
}

.result-interpretation h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
    text-align: center;
}

.interpretation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.interpretation-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    border-top: 4px solid;
}

.interpretation-item:nth-child(1) {
    border-top-color: #4CAF50; /* Green for excellent */
}

.interpretation-item:nth-child(2) {
    border-top-color: #2196F3; /* Blue for good */
}

.interpretation-item:nth-child(3) {
    border-top-color: #FF9800; /* Orange for fair */
}

.interpretation-item:nth-child(4) {
    border-top-color: #F44336; /* Red for poor */
}

.interpretation-item h4 {
    margin-bottom: 10px;
    font-size: 18px;
    color: #333;
}

.interpretation-item p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Tool Tips Section */
.tool-tips {
    margin-bottom: 40px;
}

.tool-tips h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
}

.tool-tips ul {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px 20px 20px 40px;
}

.tool-tips li {
    margin-bottom: 12px;
    color: #555;
    line-height: 1.5;
}

.tool-tips strong {
    color: #333;
}

/* Common Issues Accordion */
.common-issues {
    margin-bottom: 40px;
}

.common-issues h3 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
}

.accordion {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.accordion-item {
    border-bottom: 1px solid #eee;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 15px 20px;
    background-color: #fff;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    position: relative;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: #f9f9f9;
}

.accordion-header::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #4CAF50;
}

.accordion-header.active::after {
    content: '-';
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f9f9f9;
}

.accordion-content p {
    padding: 15px 20px 5px;
    color: #555;
}

.accordion-content ul {
    padding: 0 20px 15px 40px;
}

.accordion-content li {
    margin-bottom: 8px;
    color: #555;
}

/* Related Content */
.related-content {
    margin-top: 50px;
}

.related-content h3 {
    margin-bottom: 25px;
    font-size: 22px;
    color: #333;
    text-align: center;
}

.related-articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.related-article {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.related-article img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-article h4 {
    padding: 15px 20px 10px;
    font-size: 18px;
    color: #333;
}

.related-article p {
    padding: 0 20px 20px;
    color: #666;
    font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .data-visualization {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .tool-container {
        padding: 20px;
    }
    
    .test-area {
        height: 250px;
    }
    
    .test-results {
        width: 200px;
        font-size: 12px;
    }
    
    .interpretation-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .tool-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .test-duration {
        justify-content: center;
    }
    
    .interpretation-grid {
        grid-template-columns: 1fr;
    }
    
    .related-articles {
        grid-template-columns: 1fr;
    }
}

/* Specific Tool Styles */

/* Polling Rate Test */
#testArea {
    cursor: crosshair;
}

/* DPI Analyzer */
/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.step-navigation::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 10%;
    right: 10%;
    height: 2px;
    background-color: #e0e0e0;
    z-index: 1;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 33.333%;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f1f1f1;
    border: 2px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 20px;
    color: #888;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: #888;
    transition: all 0.3s ease;
}

.step-indicator.active .step-number {
    background-color: #4CAF50;
    border-color: #4CAF50;
    color: white;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.step-indicator.active .step-label {
    color: #4CAF50;
    font-weight: 600;
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-header {
    margin-bottom: 25px;
    text-align: center;
}

.step-header h4 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.step-header p {
    color: #666;
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.step-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Calibration Methods */
.calibration-methods {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
}

.calibration-method {
    display: none;
    animation: fadeIn 0.5s ease;
}

.calibration-method.active {
    display: block;
}

.calibration-method h5 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.calibration-tabs {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.calibration-tab {
    padding: 8px 15px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
}

.calibration-tab.active {
    background-color: #4CAF50;
    color: white;
}

.calibration-container {
    text-align: center;
    margin: 30px 0;
}

.calibration-card-container {
    display: inline-block;
    position: relative;
    margin-bottom: 40px;
}

.calibration-card {
    display: inline-block;
    width: 320px;
    height: 200px;
    background-color: #fff;
    border: 2px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    border-radius: 10px;
    background-image: linear-gradient(135deg, #f5f5f5 25%, transparent 25%, transparent 50%, #f5f5f5 50%, #f5f5f5 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    transition: all 0.3s ease;
}

.calibration-card::after {
    content: "Credit Card Size";
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.card-resize-handle {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    cursor: nwse-resize;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.calibration-controls {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container label {
    font-weight: 500;
    color: #555;
    width: 60px;
    text-align: right;
}

.slider {
    width: 200px;
}

.slider-container span {
    font-weight: 500;
    color: #333;
    width: 80px;
}

/* Manual Calibration */
.manual-calibration {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.input-group label {
    font-weight: 500;
    color: #555;
}

.input-group input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    width: 100px;
    text-align: center;
}

.input-help {
    font-size: 14px;
    color: #888;
    margin-top: 5px;
}

/* Measurement Area */
.measurement-container {
    margin-bottom: 30px;
}

.measurement-instructions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.instruction-step {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 30%;
}

.instruction-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.instruction-text {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.measurement-area {
    height: 300px;
    border: 2px solid #ddd;
    border-radius: 8px;
    position: relative;
    background-color: #f9f9f9;
    overflow: hidden;
    margin-bottom: 20px;
    cursor: crosshair;
}

.measurement-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.start-point, .end-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.start-point i {
    font-size: 24px;
    color: #4CAF50;
}

.start-point span, .end-point span {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 4px;
}

.measurement-path {
    height: 2px;
    background-color: #4CAF50;
    flex-grow: 1;
    display: none;
    position: relative;
}

.measurement-path::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
}

.measurement-path::after {
    content: '';
    position: absolute;
    top: -4px;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
}

.measurement-status {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-top: 1px solid #ddd;
}

.status-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
    text-align: center;
}

.measurement-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.progress-label {
    font-weight: 500;
    color: #333;
}

.progress-value {
    font-weight: 700;
    color: #4CAF50;
    font-size: 18px;
}

.measurement-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.measurement-counter {
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

.measurement-counter span:last-child {
    color: #4CAF50;
    margin-left: 5px;
}

.axis-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.axis-toggle label {
    font-weight: 500;
    color: #555;
}

.axis-toggle select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Vertical Test Styling */
.vertical-test .measurement-guide {
    flex-direction: column;
    padding: 50px 0;
}

.vertical-test .measurement-path {
    width: 2px !important;
    height: auto !important;
}

/* Results Styling */
.results-container {
    margin-bottom: 40px;
}

.results-summary {
    margin-bottom: 30px;
}

.primary-result {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 30px;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.primary-result .result-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.primary-result .result-value {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 5px;
}

.primary-result .result-label {
    font-size: 16px;
    font-weight: 500;
}

.result-cards {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.result-card {
    flex: 1;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

.result-card .result-icon {
    font-size: 24px;
    color: #4CAF50;
    margin-bottom: 15px;
}

.result-card .result-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.result-card .result-label {
    font-size: 14px;
    color: #666;
}

.results-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.dpi-comparison {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dpi-comparison h5 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.comparison-scale {
    position: relative;
    margin-top: 40px;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.scale-labels span {
    font-size: 14px;
    color: #666;
    width: 25%;
    text-align: center;
}

.scale-bar {
    display: flex;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.scale-segment {
    width: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.scale-marker {
    position: absolute;
    top: -15px;
    width: 2px;
    height: 50px;
    background-color: #333;
    transform: translateX(-50%);
}

.scale-marker::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5px;
    width: 12px;
    height: 12px;
    background-color: #333;
    border-radius: 50%;
}

.recommendations {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.recommendations h5 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.recommendation-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.recommendation-icon {
    width: 40px;
    height: 40px;
    background-color: #e8f5e9;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #4CAF50;
    font-size: 18px;
    flex-shrink: 0;
}

.recommendation-content h6 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.recommendation-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Save Results Button */
.btn-success {
    background-color: #2196F3;
    color: white;
}

.btn-success:hover {
    background-color: #1976D2;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .results-details {
        grid-template-columns: 1fr;
    }
    
    .recommendation-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .measurement-instructions {
        flex-direction: column;
        gap: 15px;
    }
    
    .instruction-step {
        width: 100%;
    }
    
    .result-cards {
        flex-direction: column;
    }
    
    .calibration-controls {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .step-navigation::before {
        display: none;
    }
    
    .step-indicator {
        width: auto;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    .measurement-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .calibration-card {
        width: 240px;
        height: 150px;
    }
}

/* Click Speed Tester */
.click-area {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    background-color: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.click-area:hover {
    background-color: #e9e9e9;
}

.click-area:active {
    background-color: #d9d9d9;
}

.click-counter {
    font-size: 48px;
    font-weight: 700;
    color: #4CAF50;
}

/* Mouse Acceleration Checker */
.acceleration-test-area {
    position: relative;
    height: 300px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.start-marker, .end-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.start-marker {
    left: 50px;
}

.end-marker {
    right: 50px;
}

/* Mouse Latency Benchmark */
.target {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: #F44336;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.target:hover {
    transform: scale(1.05);
}

.target:active {
    transform: scale(0.95);
}

/* Mouse Sensor Quality Test */
.sensor-test-canvas {
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 4px;
    cursor: crosshair;
}

.sensor-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.sensor-metric {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.sensor-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #4CAF50;
    margin: 5px 0;
}

.sensor-metric-label {
    font-size: 14px;
    color: #666;
}
