/* Create Invite Page Styles */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 8px 0;
}

.logo-link {
    text-decoration: none;
}

.header-logo {
    height: 48px;
    width: auto;
    border-radius: 10px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-link {
    color: var(--primary-dark, #1a3a5c);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.header-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--accent-orange, #ff8c42);
}

/* Date/Time input — prevent overflow on mobile (iOS Safari) */
input[type="datetime-local"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.invitation-card {
    box-sizing: border-box;
    overflow: hidden;
}

/* Unit Switcher (km / mi) */
.unit-switcher {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    max-width: 200px;
}

.unit-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-light, #f8f9fa);
    color: var(--text-light, #666);
}

.unit-btn.active {
    background: var(--accent-blue, #4a9fd8);
    color: white;
}

.unit-btn:not(.active):hover {
    background: #e5e7eb;
}

/* Form Subtitle */
.form-subtitle {
    text-align: center;
    color: var(--text-light, #666);
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

/* Textarea */
.invitation-card textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    resize: vertical;
}

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

/* Form Row (side by side) */
.form-row {
    display: flex;
    gap: 12px;
}

.form-group-half {
    flex: 1;
}

/* Input with unit selector */
.input-with-unit {
    display: flex;
    gap: 0;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

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

.input-with-unit input {
    border: none !important;
    border-radius: 0 !important;
    flex: 1;
    box-shadow: none !important;
}

.input-with-unit input:focus {
    box-shadow: none !important;
}

.input-with-unit select {
    border: none;
    border-left: 2px solid #e5e7eb;
    padding: 8px 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--bg-light, #f8f9fa);
    cursor: pointer;
    outline: none;
    color: var(--text-dark, #333);
}

/* Full width button */
.btn-full {
    width: 100%;
    text-align: center;
    display: block;
    box-sizing: border-box;
}

/* Share Link Box */
.share-link-box {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    align-items: center;
}

.share-url-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-dark, #333);
    background: var(--bg-light, #f8f9fa);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', 'Menlo', monospace;
}

.btn-copy {
    padding: 12px 20px;
    background: var(--accent-orange, #ff8c42);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.9375rem;
    font-family: inherit;
}

.btn-copy:hover {
    background: #e67a2e;
    transform: translateY(-1px);
}

.btn-copy.copied {
    background: #22c55e;
}

/* Success Actions */
.success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn-secondary-action {
    background: var(--bg-light, #f8f9fa);
    color: var(--text-dark, #333);
    border: 2px solid #e5e7eb;
    padding: 14px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    font-family: inherit;
}

.btn-secondary-action:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Auth CTA */
.auth-cta {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
}

.auth-cta p {
    color: var(--text-light, #666);
    margin-bottom: 12px;
    font-size: 0.9375rem;
}

/* Success icon in create page */
#create-success .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;
}

#create-success h2 {
    color: var(--primary-dark, #1a3a5c);
    text-align: center;
    margin: 0 0 8px 0;
    font-size: 1.375rem;
}

/* Pace Mode Toggle */
.pace-mode-toggle {
    text-align: center;
    margin-bottom: 16px;
}

.pace-mode-toggle a {
    color: var(--accent-blue, #4a9fd8);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.pace-mode-toggle a:hover {
    text-decoration: underline;
}

/* Pace Groups */
#pace-groups-container {
    margin-bottom: 16px;
}

.pace-group-entry {
    background: var(--bg-light, #f8f9fa);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.pg-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pg-row:first-child {
    margin-bottom: 8px;
}

.pg-row .pg-name {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 600;
    box-sizing: border-box;
}

.pg-row .pg-name:focus {
    outline: none;
    border-color: var(--accent-blue, #4a9fd8);
}

.btn-remove-group {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-remove-group:hover {
    background: rgba(239, 68, 68, 0.1);
}

.pg-field {
    flex: 1;
}

.pg-field label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-light, #666);
    margin-bottom: 4px;
}

.pg-field input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    box-sizing: border-box;
}

.pg-field input:focus {
    outline: none;
    border-color: var(--accent-blue, #4a9fd8);
}

.btn-add-group {
    width: 100%;
    padding: 10px;
    background: none;
    border: 2px dashed #e5e7eb;
    border-radius: 10px;
    color: var(--accent-blue, #4a9fd8);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-group:hover {
    border-color: var(--accent-blue, #4a9fd8);
    background: rgba(74, 159, 216, 0.05);
}

/* 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) {
    .form-row {
        flex-direction: column;
    }

    .share-link-box {
        flex-direction: column;
    }

    .share-url-input {
        font-size: 0.8125rem;
    }

    .page-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}
