:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #2196F3; /* Blue */
    --accent-color: #FFC107; /* Amber */
    --background-color: #f4f7f6;
    --card-background: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    margin: 0;
    padding: 20px;
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center; /* Center auth container vertically */
    min-height: 100vh;
    box-sizing: border-box;
}

#auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 450px;
    gap: 15px;
}

#auth-page h1 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 2.5em;
    font-weight: 800;
}

#auth-container {
    background: var(--card-background);
    padding: 25px 35px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-light);
    width: 100%;
}

#auth-container p {
    margin: 0;
    color: var(--text-light);
    font-size: 1.1em;
    line-height: 1.5;
}

#login-btn {
    background-color: #db4437; /* Google Red */
    color: white;
    padding: 14px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(219, 68, 55, 0.3);
}

#login-btn:hover {
    background-color: #c33d2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(219, 68, 55, 0.4);
}

#login-btn:active {
    transform: translateY(0);
}


.container {
    background-color: var(--background-color);
    padding: 0;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 0 20px var(--shadow-light);
    border-radius: 12px;
    overflow: hidden;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 5px solid var(--accent-color);
    position: relative;
}

#user-profile {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    padding: 5px 10px;
    border-radius: 20px;
}

#user-photo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

#user-name {
    font-weight: bold;
    margin-right: 15px;
}

#logout-btn {
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}

#logout-btn:hover {
    background-color: #fbc02d;
}


header h1 {
    margin: 0;
    font-size: 2.8em;
    font-weight: 700;
    letter-spacing: 1px;
}

header p {
    margin: 10px 0 0;
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 768px) {
    main {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px var(--shadow-medium);
}

h2 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.8em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-light);
}

.input-group input[type="text"],
.input-group input[type="number"],
select {
    width: 100%;
    padding: 12px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.input-group input:focus,
select:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

button {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    width: 100%;
    font-weight: 600;
    letter-spacing: 0.5px;
}

button:hover {
    background-color: #1976D2; /* Darker blue */
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.progress-bar-container {
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 25px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px var(--shadow-light);
}

.progress-bar {
    background-color: var(--primary-color);
    height: 100%;
    width: 0%;
    border-radius: 10px;
    text-align: center;
    line-height: 25px;
    color: white;
    font-weight: bold;
    transition: width 0.5s ease-in-out;
}

.progress-display p {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.progress-display p span {
    font-weight: 700;
    color: var(--secondary-color);
}

.run-history {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.run-history h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4em;
}

.run-history ul {
    list-style-type: none;
    padding: 0;
}

.run-history li {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.run-history li span {
    font-weight: 600;
    color: var(--text-color);
}

.delete-run-btn {
    background-color: #ff5252;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.2s;
    width: auto;
    margin-left: 10px;
    font-weight: normal;
    box-shadow: 0 2px 4px rgba(255, 82, 82, 0.2);
}

.delete-run-btn:hover {
    background-color: #e53935;
    transform: translateY(-1px);
}

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

.runner-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    border: none !important;
}

footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    border-top: 3px solid var(--accent-color);
}

/* Additional styles for Route Setup and Dashboard */
.secondary-btn {
    background-color: #6c757d !important;
    margin-top: 10px;
    font-size: 0.9em;
    padding: 8px 15px;
    width: auto;
}

.secondary-btn:hover {
    background-color: #5a6268 !important;
}

.current-route p {
    font-size: 1.1rem;
    margin: 10px 0;
}

.current-route strong {
    color: var(--secondary-color);
}

#setup-section p {
    margin-bottom: 20px;
    color: var(--text-light);
}

#dashboard-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    width: 100%;
}

/* Mode Selection Styling */
.mode-selection {
    margin-bottom: 25px;
    text-align: left;
}

.mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.mode-option input {
    display: none;
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-card:hover {
    background: #f1f1f1;
}

.mode-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.mode-label {
    font-weight: bold;
    color: var(--text-light);
}

.mode-option input:checked + .mode-card {
    border-color: var(--secondary-color);
    background: #e3f2fd;
    transform: scale(1.02);
}

.mode-option input:checked + .mode-card .mode-label {
    color: var(--secondary-color);
}

/* Hierarchical Selectors Styling */
.route-selectors {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.selector-group {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    text-align: left;
}

.selector-group h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: var(--secondary-color);
}

.distance-display {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    margin-top: 10px;
}

.distance-display input {
    background: transparent;
    border: none !important;
    font-size: 1.5em !important;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    box-shadow: none !important;
}

@media (min-width: 768px) {
    #dashboard-section {
        grid-template-columns: 1fr 1fr;
    }
    .current-route {
        grid-column: 1 / -1;
    }
    .route-selectors {
        flex-direction: row;
    }
    .selector-group {
        flex: 1;
    }
}
