/* ============================================
   Self-Service Finish Time Submission
   Mobile-first, dark-mode design
   ============================================ */

/* Page Base */
.submit-time-page {
    background: #0F0F0F;
    color: #FFFFFF;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding-bottom: 3rem;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   Header
   ============================================ */

.submit-header {
    position: relative;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
}

.header-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(233, 75, 60, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
}

.submit-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin: 0;
    background: linear-gradient(135deg, #FFFFFF 0%, #E94B3C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
    font-weight: 300;
}

/* ============================================
   Search Section
   ============================================ */

.search-section {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0F0F0F;
    padding: 1rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
    transition: color 0.2s;
}

.search-wrapper:focus-within .search-icon {
    color: var(--cinnabar);
}

.search-section .search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: #1A1A1A;
    color: #FFFFFF;
    outline: none;
    transition: all 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.search-section .search-input:focus {
    border-color: var(--cinnabar);
    background: #1E1E1E;
    box-shadow: 0 0 0 4px rgba(233, 75, 60, 0.15);
}

.search-section .search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-clear:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
}

.search-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 0.5rem 0;
    transition: opacity 0.2s;
}

/* ============================================
   Main Content
   ============================================ */

.submit-main {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Loading State */
.submit-time-page .loading-state {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
}

.submit-time-page .spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--cinnabar);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #ff6b6b;
    font-size: 1rem;
}

/* Initial State */
.initial-state {
    text-align: center;
    padding: 4rem 2rem;
}

.initial-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.initial-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #FFFFFF;
}

.initial-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.leaderboard-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--verdigris) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(29, 185, 195, 0.3);
    border-radius: 12px;
    transition: all 0.3s;
    text-decoration: none;
}

.leaderboard-link:hover {
    background: rgba(29, 185, 195, 0.1);
    border-color: var(--verdigris);
    color: var(--verdigris) !important;
    transform: translateY(-2px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
}

.empty-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ============================================
   Participants List
   ============================================ */

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Participant Card */
.participant-card {
    background: #1A1A1A;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s;
}

.participant-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.participant-card.has-time {
    border-color: rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #1A1A1A 0%, #1a2e1a 100%);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.3;
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-heat {
    background: rgba(233, 75, 60, 0.15);
    color: var(--cinnabar);
    border: 1px solid rgba(233, 75, 60, 0.25);
}

.badge-division {
    background: rgba(29, 185, 195, 0.12);
    color: var(--verdigris);
    border: 1px solid rgba(29, 185, 195, 0.2);
}

.badge-type {
    background: rgba(245, 213, 71, 0.12);
    color: var(--jonquil);
    border: 1px solid rgba(245, 213, 71, 0.2);
}

.badge-partner {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card Status (already has time) */
.card-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.status-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.15);
    border: 2px solid #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4CAF50;
}

/* Time Input Section */
.time-input-area {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.time-fields {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #0F0F0F;
    border-radius: 12px;
    padding: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.3s;
}

.time-fields:focus-within {
    border-color: var(--cinnabar);
}

.time-field-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.time-field {
    width: 100%;
    flex: 1;
    padding: 0.75rem 0.25rem;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--jonquil);
    font-family: 'Courier New', monospace;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.time-field::-webkit-inner-spin-button,
.time-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-field::placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-weight: 400;
}

.time-field-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1.5px;
    text-align: center;
    font-weight: 600;
    padding-bottom: 0.15rem;
}

.time-sep {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.2);
    font-weight: 700;
    flex-shrink: 0;
}

/* Submit Button */
.submit-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    background: linear-gradient(135deg, var(--cinnabar) 0%, #d43d2e 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    min-width: 100px;
    min-height: 56px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 75, 60, 0.35);
}

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

.submit-btn:disabled {
    background: #2A2A2A;
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn.saving {
    background: #2A2A2A;
}

.submit-btn.saved {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

/* Current Time Display */
.current-time-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(76, 175, 80, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.current-time-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.current-time-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #4CAF50;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.edit-time-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-time-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ============================================
   Success Toast
   ============================================ */

.success-toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.success-toast.visible {
    bottom: 2rem;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3);
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.toast-icon {
    flex-shrink: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 400px) {
    .submit-header h1 {
        font-size: 1.8rem;
    }

    .time-input-area {
        flex-direction: column;
    }

    .submit-btn {
        width: 100%;
    }

    .time-field {
        font-size: 1.2rem;
        padding: 0.6rem 0.2rem;
    }

    .time-sep {
        font-size: 1.2rem;
    }
}

@media (min-width: 601px) {
    .submit-main {
        padding: 1.5rem;
    }

    .search-section {
        padding: 1.25rem 1.5rem 0.75rem;
    }

    .participant-card {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    .submit-header {
        padding: 3rem 2rem 2.5rem;
    }

    .submit-header h1 {
        font-size: 2.8rem;
    }
}