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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.sync-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-flex;
}

#sync-indicator {
    font-size: 12px;
}

#sync-text {
    font-size: 13px;
}

#session-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
    transition: all 0.3s;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    padding: 10px 20px;
}

#session-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#session-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.tab-content {
    display: none;
    padding: 20px;
}

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

.workout-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

#reps-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rep-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.rep-input-group label {
    min-width: 80px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.rep-input-group input {
    flex: 1;
    background: white;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.rest-timer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    color: white;
    text-align: center;
}

.rest-timer h3 {
    margin-bottom: 15px;
    color: white;
    font-size: 18px;
}

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

.timer-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.timer-circle #timer-seconds {
    font-size: 48px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.timer-circle .timer-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
}

.recommendations-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.recommendations-panel h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 18px;
}

.recommendation-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.recommendation-item h4 {
    margin-bottom: 8px;
    color: #333;
}

.recommendation-item p {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.recommendation-item .current {
    color: #888;
    font-style: italic;
}

.recommendation-item .suggestion {
    color: #667eea;
    font-weight: 600;
}

.recommendation-item.increase {
    border-left-color: #4caf50;
}

.recommendation-item.increase .suggestion {
    color: #4caf50;
}

.recommendation-item.decrease {
    border-left-color: #f44336;
}

.recommendation-item.decrease .suggestion {
    color: #f44336;
}

.no-data {
    color: #999;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.today-workout {
    margin-top: 20px;
}

.today-workout h3 {
    margin-bottom: 15px;
    color: #333;
}

.exercise-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.exercise-card h4 {
    margin-bottom: 8px;
    color: #333;
}

.exercise-card .details {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.history-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.history-list h3 {
    margin-bottom: 15px;
    color: #333;
}

.session-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.session-card .date {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.session-card .exercise-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.session-card .exercise-item:last-child {
    border-bottom: none;
}

.session-card .exercise-name {
    font-weight: 600;
    color: #333;
}

.session-card .exercise-details {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

.settings-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.settings-section h3 {
    margin-bottom: 10px;
    color: #667eea;
    font-size: 18px;
}

.settings-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-danger {
    width: 100%;
    padding: 12px;
    background: white;
    color: #f44336;
    border: 2px solid #f44336;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #f44336;
    color: white;
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

.exercise-name-container {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.exercise-select {
    flex: 1;
    min-width: 0; /* Allows flex item to shrink below content size */
}

.exercise-input-new {
    flex: 1;
    min-width: 0;
}

.exercise-add-btn {
    width: auto;
    min-width: 80px;
    padding: 12px 20px;
    white-space: nowrap;
    flex-shrink: 0; /* Prevents button from shrinking */
}

.user-name {
    color: white;
    font-weight: 600;
    margin-bottom: 10px;
}

#google-signin-button {
    display: flex;
    justify-content: center;
}

.config-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.config-section h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 18px;
}

.config-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.exercise-config-table {
    margin-bottom: 20px;
}

.exercise-config-header {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 0.5fr 1.5fr;
    gap: 10px;
    padding: 10px;
    background: #667eea;
    color: white;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
}

.exercise-config-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 0.5fr 1.5fr;
    gap: 10px;
    padding: 12px 10px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    font-size: 14px;
}

.exercise-config-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.exercise-config-row:hover {
    background: #f8f9fa;
}

.exercise-config-row a {
    color: #667eea;
    text-decoration: none;
}

.exercise-config-row a:hover {
    text-decoration: underline;
}

.exercise-duration-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.exercise-duration-input:focus {
    outline: none;
    border-color: #667eea;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
    }

    header h1 {
        font-size: 24px;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .history-controls {
        grid-template-columns: 1fr;
    }

    .exercise-config-header,
    .exercise-config-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .exercise-config-header {
        display: none;
    }

    .exercise-config-row {
        padding: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .exercise-config-row > div:before {
        content: attr(data-label);
        font-weight: 600;
        color: #667eea;
        display: block;
        margin-bottom: 5px;
    }

    .plans-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .plan-card {
        background: white;
        border-radius: 10px;
        padding: 15px;
        border: 2px solid #e0e0e0;
        transition: all 0.3s;
    }

    .plan-card:hover {
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }

    .plan-card.active {
        border-color: #4caf50;
        background: #f1f8f4;
    }

    .plan-card h4 {
        margin-bottom: 8px;
        color: #333;
        font-size: 18px;
    }

    .plan-meta {
        color: #666;
        font-size: 14px;
        margin-bottom: 8px;
    }

    .plan-status {
        color: #4caf50;
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 10px;
    }

    .plan-actions {
        display: flex;
        gap: 5px;
        margin-top: 10px;
    }

    .plan-mode-indicator {
        background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
        color: white;
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 20px;
        text-align: center;
    }

    .plan-mode-indicator p {
        margin: 0;
        font-size: 16px;
    }

    .plan-indicator {
        background: #f8f9fa;
        border: 2px solid #4caf50;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 20px;
    }

    .plan-indicator-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .plan-indicator-content span {
        font-weight: 600;
        color: #4caf50;
        font-size: 16px;
    }

    .plan-exercise-slot {
        width: 100%;
        padding: 12px;
        border: 2px solid #e0e0e0;
        border-radius: 10px;
        font-size: 16px;
        transition: border-color 0.3s;
        font-family: inherit;
    }

    .plan-exercise-slot:focus {
        outline: none;
        border-color: #667eea;
    }

    .session-controls {
        display: flex;
        gap: 10px;
        align-items: center;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .plan-selector {
        padding: 8px 15px;
        border: 2px solid #e0e0e0;
        border-radius: 10px;
        background: white;
        color: #333;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        min-width: 150px;
        transition: border-color 0.3s;
    }

    .plan-selector:focus {
        outline: none;
        border-color: #667eea;
    }

    .plan-selector option {
        background: white;
        color: #333;
        padding: 8px;
    }
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
    background: #f8f9fa;
}

footer a {
    color: #667eea;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

footer p {
    margin: 8px 0;
}

footer p:last-child {
    color: #999;
    margin-top: 10px;
}

