/* Invite Page Styles */

.invite-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--bg-light) 0%, #e8ecf1 100%);
}

.invite-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
}

/* Loading State */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light, #f8f9fa);
    border-top-color: var(--accent-orange, #ff8c42);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

#error-state h2 {
    color: var(--primary-dark, #1a3a5c);
    margin-bottom: 8px;
}

#error-state p {
    color: var(--text-light, #666);
    margin-bottom: 24px;
    text-align: center;
}

/* Crew Header */
.crew-header {
    text-align: center;
    margin-bottom: 24px;
}

.crew-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: white;
}

.crew-header h3 {
    color: var(--primary-dark, #1a3a5c);
    margin: 0;
    font-size: 1.25rem;
}

/* Invitation Card */
.invitation-card {
    background: var(--white, #fff);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.invitation-card h1 {
    color: var(--primary-dark, #1a3a5c);
    font-size: 1.5rem;
    margin: 0 0 20px 0;
    text-align: center;
}

.invite-details {
    text-align: left;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    gap: 12px;
}

.detail-row:last-child {
    border-bottom: none;
}

/* Hide border for hidden rows and prevent double lines */
.detail-row[style*="display: none"] {
    border-bottom: none;
    padding: 0;
    margin: 0;
}

/* Meeting Point Content */
.meeting-point-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.map-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.map-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.map-link.apple {
    background: #007AFF;
    color: white;
}

.map-link.apple:hover {
    background: #0056b3;
}

.map-link.google {
    background: #34A853;
    color: white;
}

.map-link.google:hover {
    background: #2d8a47;
}

.detail-icon {
    font-size: 1.25rem;
    min-width: 28px;
    text-align: center;
}

/* Pace Groups (for coaches) */
.pace-groups-container {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.pace-groups-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--primary-dark, #1a3a5c);
}

.pace-groups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 40px;
}

.pace-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    gap: 12px;
}

.pace-group-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pace-group-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pace-group-dot.green { background: #4CD964; }
.pace-group-dot.yellow { background: #FFCC00; }
.pace-group-dot.orange { background: #FF9500; }
.pace-group-dot.red { background: #FF3B30; }

.pace-group-name {
    font-weight: 500;
    color: var(--text-dark, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pace-group-pace {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', 'Menlo', monospace;
    font-size: 0.9rem;
    color: var(--text-light, #666);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Response Counts */
.response-counts {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.count-item {
    text-align: center;
}

.count-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.count-item.accept .count-number {
    color: #22c55e;
}

.count-item.decline .count-number {
    color: #ef4444;
}

.count-label {
    font-size: 0.875rem;
    color: var(--text-light, #666);
    margin-top: 4px;
}

/* Response Form */
.response-form {
    background: var(--white, #fff);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.response-form h3 {
    margin: 0 0 20px 0;
    color: var(--primary-dark, #1a3a5c);
    text-align: center;
    font-size: 1.125rem;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark, #333);
    font-size: 0.9375rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue, #4a9fd8);
    box-shadow: 0 0 0 3px rgba(74, 159, 216, 0.15);
}

.response-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-accept, .btn-decline {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-accept {
    background: #22c55e;
    color: white;
}

.btn-accept:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-decline {
    background: #f3f4f6;
    color: var(--text-dark, #333);
}

.btn-decline:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.btn-accept:disabled, .btn-decline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.form-error {
    color: #ef4444;
    margin-top: 16px;
    text-align: center;
    font-size: 0.9375rem;
}

/* Success State */
.response-success {
    text-align: center;
    padding: 32px 24px;
    background: var(--white, #fff);
    border-radius: 16px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 16px;
}

.response-success h3 {
    color: var(--primary-dark, #1a3a5c);
    margin: 0 0 8px 0;
}

.response-success p {
    color: var(--text-light, #666);
    margin-bottom: 20px;
}

/* App CTA */
.app-cta {
    text-align: center;
    margin-top: auto;
    padding: 24px 0;
    color: var(--text-light, #666);
    font-size: 0.875rem;
}

.app-logo-small {
    height: 48px;
    width: auto;
    margin-top: 8px;
    border-radius: 10px;
}

/* Create Your Own CTA */
.create-cta {
    text-align: center;
    padding: 12px 0;
}

.create-cta a {
    color: var(--accent-orange, #ff8c42);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.create-cta a:hover {
    color: #e67a2e;
    text-decoration: underline;
}

/* Page Footer */
.page-footer {
    text-align: center;
    margin-top: auto;
    padding: 24px 0 12px;
    font-size: 0.8125rem;
}

.page-footer a {
    color: var(--text-light, #666);
    text-decoration: none;
    transition: color 0.2s;
}

.page-footer a:hover {
    color: var(--accent-orange, #ff8c42);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .invite-container {
        padding: 16px;
    }

    .invitation-card,
    .response-form,
    .response-success {
        padding: 20px;
    }

    .invitation-card h1 {
        font-size: 1.25rem;
    }

    .response-buttons {
        flex-direction: column;
    }

    .count-number {
        font-size: 2rem;
    }

    .response-counts {
        gap: 32px;
    }
}
