/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%),
                url('../images/runners-bg.jpg') center/cover fixed;
    min-height: 100vh;
    padding: 20px;
}

/* ===== Container Styles ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.container.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 40px);
}

.container.chat {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    padding: 0;
}

.container.import {
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    padding: 0;
}

.container.races {
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    padding: 0;
}

.import-content {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.races-content {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

/* ===== Typography ===== */
h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

/* ===== Header Styles ===== */
.header {
    padding: 30px;
    border-bottom: 2px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    margin-bottom: 0;
    font-size: 2em;
    color: white;
}

.header-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    transition: background 0.3s;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header p {
    opacity: 0.9;
    font-size: 1em;
}

.back-button {
    display: inline-block;
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: background 0.3s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

input[type="file"],
input[type="url"],
input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

textarea {
    resize: none;
    min-height: 50px;
    max-height: 150px;
}

small {
    font-size: 0.85em;
    color: #666;
}

/* ===== Button Styles ===== */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* ===== Message Styles ===== */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #c62828;
}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.8em;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #333;
}

/* ===== Table Styles ===== */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

thead th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th.sortable {
    cursor: pointer;
    user-select: none;
}

thead th:hover {
    background: rgba(0, 0, 0, 0.1);
}

thead th.sortable::after {
    content: ' ⇅';
    opacity: 0.5;
    font-size: 0.8em;
}

thead th.sorted-asc::after {
    content: ' ▲';
    opacity: 1;
}

thead th.sorted-desc::after {
    content: ' ▼';
    opacity: 1;
}

tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background: #f5f7ff;
    cursor: pointer;
}

tbody tr:nth-child(even) {
    background: #fafbfc;
}

tbody tr:nth-child(even):hover {
    background: #f0f2f5;
}

tbody td {
    padding: 10px;
}

.table-note {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.results-table {
    font-size: 0.9em;
}

/* ===== Import Specific Styles ===== */
.import-options {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.import-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    color: white;
    border: none;
}

.import-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.import-card.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.import-card h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.import-card p {
    font-size: 0.9em;
    opacity: 0.9;
}

.import-form {
    display: none;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
}

.import-form.active {
    display: block;
    animation: fadeIn 0.3s;
}

.temp-table-preview {
    margin-bottom: 30px;
    max-height: 500px;
    overflow: auto;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.temp-table-preview h4 {
    margin-bottom: 15px;
    color: #333;
}

/* ===== Chat Specific Styles ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message.user,
.message.assistant {
    display: flex;
    gap: 15px;
    animation: fadeIn 0.3s;
}

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message.assistant .message-avatar {
    background: #e8f5e9;
    color: #4CAF50;
}

.message-content {
    max-width: 90%;
    padding: 15px 20px;
    border-radius: 15px;
    line-height: 1.6;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.assistant .message-content {
    background: #f5f5f5;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.thinking {
    display: flex;
    gap: 5px;
    padding: 10px 0;
}

.thinking span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.thinking span:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking span:nth-child(2) {
    animation-delay: -0.16s;
}

.input-container {
    padding: 20px 30px;
    border-top: 2px solid #eee;
    background: #fafafa;
    border-radius: 0 0 20px 20px;
    position: relative;
}

.examples-button {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.examples-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.examples-popup {
    position: absolute;
    bottom: 100%;
    left: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

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

.examples-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #eee;
}

.examples-popup-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: #f5f5f5;
}

.examples-popup-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.example-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.example-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(5px);
}

.example-item .arrow {
    color: #667eea;
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.3s;
}

.example-item:hover .arrow {
    opacity: 1;
}

.no-examples, .loading {
    text-align: center;
    padding: 30px;
    color: #999;
}

.input-form {
    display: flex;
    gap: 10px;
    margin-left: 60px;
}

.input-form button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.suggestions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.suggestion-chip {
    padding: 8px 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.suggestion-chip:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

/* ===== Races List Specific Styles ===== */
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.search-box {
    flex: 1;
    max-width: 400px;
}

.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 0.9em;
    font-weight: 600;
}

.race-name-cell {
    font-weight: 600;
    color: #333;
}

.badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    display: inline-block;
}

.badge.provider {
    background: #e8f5e9;
    color: #388e3c;
}

.badge.results {
    background: #fff3e0;
    color: #f57c00;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.2em;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    color: #666;
    margin-bottom: 20px;
}

.empty-state p {
    color: #999;
    margin-bottom: 30px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ===== Login Styles ===== */
.login-box {
    max-width: 400px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-box .header {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.login-box .header p {
    color: #666;
    font-size: 0.95em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

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

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

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.link-secondary {
    color: #667eea;
    text-decoration: none;
    font-size: 0.95em;
}

.link-secondary:hover {
    text-decoration: underline;
}

.flash-message {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.flash-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.flash-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 10px;
        border-radius: 10px;
        max-width: 100%;
    }

    .container.chat {
        height: calc(100vh - 10px);
        padding: 0;
    }

    h1 {
        font-size: 1.5em;
    }

    .header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header h1 {
        font-size: 1.3em;
        margin-bottom: 10px;
    }

    .header-nav {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .nav-link {
        font-size: 0.85em;
        padding: 6px 10px;
    }

    .login-box {
        padding: 30px 20px;
    }

    /* Examples button mobile */
    .examples-button {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
        left: 10px;
    }

    .examples-popup {
        left: 10px;
        width: calc(100vw - 20px);
    }

    .input-form {
        margin-left: 55px;
    }

    .import-options {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .search-box {
        max-width: 100%;
    }

    .stats {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    /* Chat mobile optimization */
    .chat-container {
        padding: 10px;
        gap: 15px;
    }

    .message.user,
    .message.assistant {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .message.user {
        align-items: flex-end;
    }

    .message-avatar {
        font-size: 1em;
        min-width: 28px;
        width: 28px;
        height: 28px;
    }

    .message-content {
        max-width: 100%;
        width: 100%;
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .message-content p {
        font-size: 0.95em;
    }

    /* Input container mobile */
    .input-container {
        padding: 10px;
    }

    .suggestions {
        gap: 5px;
        margin-bottom: 8px;
    }

    .suggestion-chip {
        padding: 6px 10px;
        font-size: 0.85em;
    }

    .input-form {
        gap: 8px;
    }

    .input-form input {
        font-size: 0.95em;
        padding: 12px;
    }

    .input-form button {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    /* Table mobile */
    table {
        font-size: 0.8em;
    }

    thead th,
    tbody td {
        padding: 6px 4px;
    }

    /* Smaller font for race names in tables */
    tbody td:has(+ td + td + td),
    tbody td:nth-last-child(1) {
        font-size: 0.75em;
        line-height: 1.2;
    }
}

/* Extra small devices (phones in portrait, less than 480px) */
@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        padding: 5px;
    }

    .container.chat {
        height: 100vh;
    }

    .header {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.2em;
    }

    .chat-container {
        padding: 8px;
        gap: 10px;
    }

    .message.user,
    .message.assistant {
        flex-direction: column;
        align-items: flex-start;
    }

    .message.user {
        align-items: flex-end;
    }

    .message-avatar {
        font-size: 0.9em;
        min-width: 26px;
        width: 26px;
        height: 26px;
    }

    .message-content {
        max-width: 100%;
        width: 100%;
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .input-container {
        padding: 8px;
    }

    .suggestions {
        gap: 4px;
        margin-bottom: 6px;
    }

    .suggestion-chip {
        padding: 5px 8px;
        font-size: 0.8em;
    }

    .input-form input {
        font-size: 0.9em;
        padding: 10px;
    }

    .input-form button {
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

/* ===== Calculator Styles ===== */
.container.calculator {
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    padding: 0;
}

.calculator-content {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

.info-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-box p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.calculator-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.calculator-form h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5em;
}

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

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

.input-row {
    display: flex;
    gap: 10px;
}

.input-row input[type="number"] {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.input-row input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.input-row select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    min-width: 140px;
}

.quick-distances {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.quick-distances button {
    padding: 8px 16px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.quick-distances button:hover {
    background: #667eea;
    color: white;
}

.time-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-inputs input[type="number"] {
    width: 80px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

.time-inputs input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.time-inputs span {
    color: #666;
    font-size: 14px;
}

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

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.results-container {
    margin-top: 30px;
}

.results-container h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.result-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.result-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    margin-bottom: 25px;
}

.result-card h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.result-card h4 {
    margin-bottom: 10px;
    color: #667eea;
    font-size: 1.1em;
}

.result-card.primary h4 {
    color: white;
}

.big-number {
    font-size: 3.5em;
    font-weight: bold;
    margin: 10px 0;
}

.number {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
    color: #333;
}

.unit {
    font-size: 1em;
    opacity: 0.8;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.splits-section {
    margin-top: 30px;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.splits-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.splits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.split-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.split-label {
    font-weight: 600;
    color: #333;
}

.split-time {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
}

.tips-section {
    margin-top: 30px;
    background: #fffbeb;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #fbbf24;
}

.tips-section h3 {
    color: #92400e;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.tip {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.tip:last-child {
    margin-bottom: 0;
}

/* Responsive dla kalkulatora */
@media (max-width: 768px) {
    .calculator-content {
        padding: 20px;
    }

    .calculator-form {
        padding: 20px;
    }

    .time-inputs {
        flex-wrap: wrap;
    }

    .time-inputs input[type="number"] {
        width: 60px;
        padding: 10px;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .splits-grid {
        grid-template-columns: 1fr;
    }

    .big-number {
        font-size: 2.5em;
    }

    .number {
        font-size: 1.5em;
    }
}
