* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4b5563;
    --primary-light: #6b7280;
    --accent-color: #9ca3af;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.1), 0 20px 30px rgba(0, 0, 0, 0.15);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-color: #f9fafb;
    --selected-bg: #f3f4f6;
    --gauge-color: #4b5563;
    --gauge-bg: #e5e7eb;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.headline {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: 0.01em;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

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

/* Circular Speed Gauge */
.speed-gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.circular-gauge {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
}

.gauge-background {
    transition: stroke 0.3s ease;
}

.gauge-progress {
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease;
}

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

.gauge-content .speed-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.gauge-content .speed-unit {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.gauge-heading {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
    letter-spacing: -0.01em;
}

.gauge-subheading {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    font-weight: 400;
}

/* User Selector */
.users-selector-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    max-width: 400px;
    margin: 0 auto 30px;
}

.users-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.users-icon {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

.users-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.user-btn:hover:not(:disabled) {
    background: var(--selected-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.user-btn:active:not(:disabled) {
    transform: scale(0.95);
}

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

.user-input {
    width: 80px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--card-bg);
    transition: all 0.2s ease;
    -moz-appearance: textfield;
}

.user-input::-webkit-outer-spin-button,
.user-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.user-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.1);
}

.users-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    font-weight: 400;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.device-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.device-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent-color);
}

.device-card:hover::before {
    transform: scaleX(1);
}

.device-card.selected {
    border-color: var(--primary-color);
    background: var(--selected-bg);
}

.device-card.selected::before {
    transform: scaleX(1);
}

.device-checkbox {
    display: flex;
    align-items: center;
    gap: 16px;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: white;
}

.device-card.selected .custom-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-checkbox::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.device-card.selected .custom-checkbox::after {
    transform: translate(-50%, -60%) rotate(45deg) scale(1);
}

.device-info {
    flex: 1;
}

.device-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.device-speed {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.device-speed-value {
    font-weight: 600;
    color: var(--primary-color);
}

.device-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 4px;
}

.device-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--selected-bg);
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.device-card:hover .device-icon-wrapper {
    background: var(--border-color);
    transform: scale(1.05);
}

.device-card.selected .device-icon-wrapper {
    background: rgba(75, 85, 99, 0.1);
}

.device-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.device-card.selected .device-icon {
    color: var(--primary-color);
}


.speed-category {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    margin-top: 20px;
    position: relative;
    flex-wrap: wrap;
}

.category-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.category-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.disclaimer-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    cursor: help;
}

.info-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.disclaimer-tooltip:hover .info-icon {
    color: var(--primary-color);
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 280px;
    white-space: normal;
    width: max-content;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--text-primary) transparent transparent transparent;
}

.disclaimer-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Mobile adjustments for tooltip */
@media (max-width: 768px) {
    .speed-category {
        flex-direction: column;
        text-align: center;
    }
    
    .disclaimer-tooltip {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .tooltip-text {
        left: 50%;
        transform: translateX(-50%);
        max-width: 250px;
    }
}

/* Ad Section */
.ad-section {
    max-width: 1200px;
    margin: 40px auto 0;
}

.ad-tagline {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    font-weight: 400;
    font-style: italic;
}

/* Ad Container */
.ad-container {
    padding: 24px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.ad-container ins {
    display: block;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

/* Style ad container to blend with design */
.ad-container .adsbygoogle {
    background: transparent;
    border-radius: 8px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
}

.developer-name {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.developer-name:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.developer-name:active {
    opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .headline {
        font-size: 1rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .devices-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .device-card {
        padding: 20px;
    }

    .circular-gauge {
        width: 200px;
        height: 200px;
    }

    .gauge-content .speed-value {
        font-size: 2.5rem;
    }

    .gauge-heading {
        font-size: 1.5rem;
    }

    .users-selector-container {
        padding: 20px;
        max-width: 100%;
    }

    .users-label {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.75rem;
    }

    .headline {
        font-size: 0.95rem;
    }

    .device-card {
        padding: 18px;
    }

    .device-name {
        font-size: 1rem;
    }

    .circular-gauge {
        width: 180px;
        height: 180px;
    }

    .gauge-content .speed-value {
        font-size: 2rem;
    }

    .gauge-heading {
        font-size: 1.25rem;
    }

    .gauge-subheading {
        font-size: 0.9rem;
    }

    .users-selector-container {
        padding: 18px;
    }

    .user-btn {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .user-input {
        width: 70px;
        height: 40px;
        font-size: 1.1rem;
    }

    .users-hint {
        font-size: 0.85rem;
    }

    .ad-section {
        margin: 30px auto 0;
    }

    .ad-tagline {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .ad-container {
        padding: 20px;
        min-height: 80px;
        border-radius: 12px;
    }

    .footer {
        margin-top: 20px;
        padding: 24px 15px;
    }

    .footer-text {
        font-size: 0.85rem;
    }
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease;
}

