@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    color: #333;
}

.container {
    position: relative;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 550px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-logo {
    display: block;
    width: 160px;
    max-width: 60%;
    margin: 0 auto 1rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #333;
    font-weight: 700;
    letter-spacing: -1px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

#settings-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: #888;
    transition: color 0.3s, transform 0.3s;
}

#settings-btn:hover {
    color: #333;
    transform: rotate(45deg);
}

.exercise-selector {
    margin-bottom: 2rem;
}

.exercise-selector label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #555;
}

#exercise {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#exercise:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.timer-container {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
}

.timer-container label {
    font-size: 1rem;
    color: #555;
}

.timer-container input {
    width: 80px;
    padding: 0.5rem;
    font-size: 1rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
}

#timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

#start-btn {
    background-color: #007bff;
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

#start-btn:hover {
    background-color: #0056b3;
}

#start-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

.counters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.counter {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.counter:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.counter.clickable:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.counter h2 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #555;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counter p {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0;
    color: #333;
}

#successful-reps {
    color: #28a745;
}

#missed-reps {
    color: #dc3545;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.buttons button {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

#reset-btn {
    background-color: #6c757d;
    color: white;
}

#reset-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#summary-btn {
    grid-column: 1 / -1;
    background-color: #17a2b8;
    color: white;
    margin-top: 0.5rem;
}

#summary-btn:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    padding-top: 60px;
}

/* Modal Content/Box */
.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 700px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: animatetop 0.4s;
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

/* The Close Button */
.close-btn, .close-settings-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus,
.close-settings-btn:hover,
.close-settings-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#summary-table th, #summary-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

#summary-table th {
    background-color: #f2f2f2;
    color: #333;
}

#summary-table tbody tr:nth-child(even){background-color: #f9f9f9;}

#summary-table tbody tr:hover {background-color: #ddd;}

.settings-field {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.settings-field label {
    font-size: 1rem;
    color: #555;
}

.settings-field input {
    width: 100px;
    padding: 0.5rem;
    font-size: 1rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
}

#qrcode-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 10px;
}

#qrcode {
    padding: 0.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#qrcode .error-msg {
    font-size: 0.9rem;
    color: #dc3545;
    margin-bottom: 0.5rem;
}

#qrcode textarea {
    width: 100%;
    height: 100px;
    font-family: monospace;
    font-size: 0.8rem;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}
