:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    background: var(--accent-red);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.primary-btn {
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.runs-grid {
    display: grid;
    gap: 16px;
}

/* Glass Card */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.run-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: default;
    border: 2px solid transparent;
}

.run-card.active {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.run-card:hover {
    transform: none;
    /* Removed scale for dashboard cards */
    border-color: rgba(255, 255, 255, 0.2);
}

.run-card.active:hover {
    border-color: var(--accent-red);
}

.run-main-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.run-main-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.time-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.run-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
}

.map-container {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.time-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.time-pill strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.active-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-orange);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.modal {
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hidden {
    display: none !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Form */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input[type="text"],
input[type="time"],
textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
}

input:focus {
    border-color: var(--accent-red);
}

.time-row {
    display: flex;
    gap: 8px;
}

.stamp-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.stamp-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.time-item {
    margin-bottom: 16px;
}

.time-item span {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

.submit-btn:hover {
    filter: brightness(1.1);
}

.delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.delete-btn:hover {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}