.tool-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.tool-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}

.back-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Speed Test Container */
.speed-test-container {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.speed-test-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
}

/* Speedometer */
.speedometer-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.speedometer {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(255, 107, 53, 0.2));
}

.speedometer-bg {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-linecap: round;
}

.speedometer-progress {
    stroke: url(#speedGradient);
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    transition: stroke-dashoffset 0.3s ease;
}

.speedometer-needle {
    stroke: var(--primary-color);
    transform-origin: 100px 100px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 5px rgba(255, 107, 53, 0.5));
}

.speedometer-value {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.speed-number {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1;
    font-family: 'Courier New', monospace;
}

.speed-unit {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    margin-top: 0.5rem;
}

.speed-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

/* Start Button */
.btn-start {
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    min-width: 200px;
}

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

.btn-start:disabled:hover {
    transform: none;
}

/* Progress Indicator */
.test-progress {
    width: 100%;
    max-width: 500px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.result-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.result-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.result-unit {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

/* Connection Info */
.connection-info {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.connection-info h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connection-info h3 i {
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.info-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.info-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* History Container */
.history-container {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.history-header h3 {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.history-header h3 i {
    color: var(--primary-color);
}

.btn-clear-history {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--error-color);
    border-radius: var(--radius-md);
    color: var(--error-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear-history:hover {
    background: var(--error-color);
    color: white;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.history-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.history-speed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.history-speed i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Tips Section */
.tips-section {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.tips-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-section h3 i {
    color: var(--warning-color);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.tip-card {
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.tip-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.1);
}

.tip-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.testing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }

    .back-button {
        top: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
    }

    .speed-test-container {
        padding: 2rem 1rem;
    }

    .speedometer-container {
        max-width: 300px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .history-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .history-speed {
        justify-content: space-between;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .speed-number {
        font-size: 2.5rem;
    }

    .btn-start {
        width: 100%;
        padding: 1rem 2rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-clear-history {
        width: 100%;
        justify-content: center;
    }
}