* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #222;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Fix for iOS height issues */
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Fix for mobile height issues */
html {
    height: -webkit-fill-available;
}

header {
    text-align: center;
    padding: 20px 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    width: 100%;
}

.container {
    text-align: center;
    padding: 20px 15px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.test-container {
    margin-bottom: 20px;
    width: 100%;
}

.about-test {
    margin-bottom: 30px;
    width: 100%;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 8px;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin-bottom: 20px;
    opacity: 0.8;
}

h2 {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
    margin-top: 30px;
    margin-bottom: 20px;
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    margin-top: 20px;
    margin-bottom: 15px;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn {
    padding: clamp(10px, 3vw, 12px) clamp(20px, 5vw, 30px);
    border: none;
    border-radius: 30px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    min-width: clamp(100px, 30vw, 120px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    touch-action: manipulation; /* Improves touch response */
    -webkit-appearance: none; /* Fix for iOS buttons */
}

.btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.start-btn {
    background-color: #888;
}

.stop-btn {
    background: linear-gradient(to right, #4e73df, #6d8ef5);
}

.reset-btn {
    background: linear-gradient(to right, #6d8ef5, #8ea8f7);
}

.share-btn {
    background: linear-gradient(to right, #28a745, #5dd879);
    margin-top: 15px;
}

.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    width: 100%;
}

.timer-circle {
    position: relative;
    width: clamp(220px, 80vw, 300px);
    height: clamp(220px, 80vw, 300px);
    max-width: 100%;
}

.progress-ring {
    position: relative;
    width: 100%;
    height: 100%;
}

.progress-ring__svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 5px rgba(78, 115, 223, 0.4));
}

.progress-ring__circle-bg {
    fill: transparent;
    stroke: #444;
    stroke-dasharray: 754;
    stroke-dashoffset: 0;
    stroke-linecap: round;
}

.progress-ring__circle {
    fill: transparent;
    stroke: #4e73df;
    stroke-dasharray: 754;
    stroke-dashoffset: 754;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s linear;
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.performance-indicators {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.indicator {
    display: flex;
    align-items: center;
    font-size: clamp(1rem, 3vw, 1.2rem);
    margin: 5px;
}

.dot {
    display: inline-block;
    width: clamp(12px, 3vw, 15px);
    height: clamp(12px, 3vw, 15px);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.poor {
    background-color: #e74a3b;
}

.average {
    background-color: #f6c23e;
}

.amazing {
    background-color: #1cc88a;
}

.result-display {
    margin: 20px auto;
    padding: clamp(15px, 5vw, 20px);
    border-radius: 10px;
    background-color: rgba(40, 40, 40, 0.9);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.5s ease forwards;
    width: 100%;
    max-width: 500px;
    text-align: center;
}

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

.result-display h3 {
    font-size: clamp(1.3rem, 4vw, 1.5rem);
    margin-bottom: 10px;
}

.result-display.hidden {
    display: none;
}

.result-text {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: bold;
    margin: 15px auto;
    padding: clamp(8px, 3vw, 10px) clamp(15px, 5vw, 20px);
    border-radius: 5px;
    display: inline-block;
    animation: pulse 1s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

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

.result-text.poor {
    color: #ffffff;
    background-color: #e74a3b;
}

.result-text.average {
    color: #000000;
    background-color: #f6c23e;
}

.result-text.amazing {
    color: #ffffff;
    background-color: #1cc88a;
}

/* Info Section Styles */
.info-section {
    text-align: left;
    background-color: rgba(40, 40, 40, 0.5);
    border-radius: 10px;
    padding: clamp(15px, 5vw, 30px);
    margin-top: 20px;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.info-section p {
    font-size: clamp(0.9rem, 3vw, 1rem);
    margin-bottom: 15px;
}

.info-section ol,
.info-section ul {
    margin-left: clamp(15px, 5vw, 20px);
    margin-bottom: 20px;
}

.info-section li {
    margin-bottom: 10px;
    font-size: clamp(0.9rem, 3vw, 1rem);
}

.disclaimer {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: #aaa;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 20px;
}

/* Footer Styles */
footer {
    background-color: rgba(0, 0, 0, 0.3);
    padding: clamp(15px, 4vw, 20px);
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 3vw, 20px);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
    margin: 5px;
    font-size: clamp(0.85rem, 3vw, 1rem);
    padding: 5px 3px;
}

.footer-links a:hover,
.footer-links a:active,
.footer-links a:focus {
    color: #fff;
    text-decoration: underline;
}

.copyright {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: #777;
}

/* Result Card for Sharing */
.result-card-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.result-card-container.hidden {
    display: none;
}

.result-card {
    width: clamp(280px, 90vw, 600px);
    background: linear-gradient(145deg, #1e1e1e, #333);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 95%;
}

.result-card-header {
    background: linear-gradient(90deg, #1a1a1a, #333);
    padding: clamp(15px, 4vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #444;
}

.result-card-title {
    color: #fff;
    font-size: clamp(1.5rem, 5vw, 1.8rem);
    margin: 0;
}

.result-card-body {
    padding: clamp(20px, 6vw, 30px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-card-content {
    text-align: center;
    width: 100%;
}

.result-card-label {
    font-size: clamp(1.2rem, 4vw, 1.4rem);
    color: #ccc;
    margin-bottom: 15px;
}

.result-card-time {
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
}

.result-card-result {
    display: inline-block;
    padding: clamp(10px, 3vw, 12px) clamp(20px, 6vw, 25px);
    border-radius: 8px;
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.result-card-footer {
    background-color: rgba(0, 0, 0, 0.3);
    padding: clamp(12px, 4vw, 15px);
    text-align: center;
    color: #aaa;
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    border-top: 1px solid #444;
}

#shareCanvas {
    position: absolute;
    top: -9999px;
    left: -9999px;
}

.hidden {
    display: none;
} 