@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #2b6cb0;
    --primary-dark: #1a365d;
    --accent: #4299e1;
    --bg-gradient: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.45);
    --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    --text-main: #2d3748;
    --text-muted: #718096;
}

.kwh-form-container {
    font-family: 'Inter', sans-serif;
    max-width: 800px;
    margin: 40px auto;
    padding: 0;
    border-radius: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    color: var(--text-main);
}

.kwh-form-body {
    padding: 0 40px;
}

/* Header Area */
.kwh-reg-header {
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.4) 100%);
    padding: 40px;
    border-bottom: 1px solid var(--card-border);
    text-align: center;
}

.kwh-reg-header h2 {
    margin: 0 0 10px 0;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary-dark);
}

/* Section Styling (Formerly Steps) */
.kwh-form-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    animation: fadeIn 0.5s ease-out;
}

.kwh-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.kwh-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kwh-section-title span.dashicons {
    color: var(--primary);
    font-size: 1.4rem;
    width: 24px;
    height: 24px;
}

.kwh-form-footer {
    display: flex;
    justify-content: center;
    padding: 20px 40px 40px;
    margin-top: 20px;
    border-top: 1px solid var(--card-border);
}

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

/* Member Profile Card */
#kwh-lookup-status {
    margin-bottom: 30px;
}

.kwh-profile-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    margin-top: 15px;
}

.kwh-profile-avatar {
    width: 60px;
    height: 60px;
    background: #f0f4f8;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kwh-profile-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.kwh-profile-club {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.kwh-status-badge {
    background: #e6fffa;
    color: #319795;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto;
}

/* Inputs & Groups */
.kwh-form-group {
    margin-bottom: 25px;
}

.kwh-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.kwh-form-group input:not([type="file"]):not([type="checkbox"]), 
.kwh-form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #eef2f6;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.kwh-form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.kwh-form-group input:focus, 
.kwh-form-group select:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.1);
}

/* File Input Styling */
.kwh-form-group input[type="file"] {
    background: #f7fafc;
    padding: 15px;
    border: 2px dashed #cbd5e0;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
}

/* Navigation Buttons */
.kwh-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
}

.kwh-btn {
    padding: 16px 30px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.kwh-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    flex: 1;
}

.kwh-btn-secondary {
    background: #edf2f7;
    color: var(--text-main);
}

.kwh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

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

.kwh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Utilities */
.kwh-notice {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.kwh-notice.info { background: #ebf8ff; color: #3182ce; }
.kwh-notice.error { background: #fff5f5; color: #e53e3e; }
.kwh-notice.success { background: #f0fff4; color: #38a169; }

/* Searchable Lookup Component */
.kwh-lookup-wrapper {
    position: relative;
    width: 100%;
}

.kwh-lookup-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #eef2f6;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    padding-left: 40px; /* Space for search icon on the left */
    padding-right: 18px;
}

.kwh-lookup-input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.1);
}

.kwh-lookup-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.05);
    display: none; /* Hidden by default */
}

.kwh-lookup-item {
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kwh-lookup-item:hover {
    background: #f7fafc;
}

.kwh-lookup-item.active {
    background: #ebf8ff;
    color: var(--primary);
    font-weight: 600;
}

.kwh-lookup-item .priority-badge {
    font-size: 0.7rem;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #4a5568;
}

/* Scrollbar Style */
.kwh-lookup-results::-webkit-scrollbar {
    width: 6px;
}
.kwh-lookup-results::-webkit-scrollbar-track {
    background: transparent;
}
.kwh-lookup-results::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}
/* Multi-File Attachment UI */
.kwh-existing-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.kwh-att-badge {
    background: rgba(43, 108, 176, 0.05);
    border: 1px solid rgba(43, 108, 176, 0.2);
    padding: 8px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.kwh-att-badge a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.kwh-att-badge .dashicons-media-document {
    color: var(--primary);
    font-size: 18px;
    margin-top: 2px;
}

.kwh-att-badge .kwh-remove-att {
    cursor: pointer;
    color: #e53e3e;
    font-size: 16px;
    margin-right: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.kwh-att-badge .kwh-remove-att:hover {
    opacity: 1;
}

.kwh-att-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    background: rgba(43, 108, 176, 0.08);
}

.kwh-form-group.error input[type="file"] {
    border-color: #e53e3e;
    background: #fff5f5;
}

/* ID Method Toggle */
.kwh-method-label {
    background: transparent;
    opacity: 0.6;
}

.kwh-method-label:not(.active):hover {
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
}

.kwh-method-label.active {
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    opacity: 1;
    color: var(--primary);
}

.kwh-method-label span.dashicons {
    font-size: 20px;
}

/* Responsive Adjustments */
@media (max-width: 850px) {
    .kwh-form-container {
        margin-left: 15px;
        margin-right: 15px;
        border-radius: 20px;
    }
}

@media (max-width: 600px) {
    .kwh-reg-header,
    .kwh-form-body,
    .kwh-form-footer {
        padding: 25px 20px;
    }
    
    .kwh-form-row {
        grid-template-columns: 1fr !important;
    }
}

/* ── Elegant Personal Details Section ── */
#kwh-member-details-fields {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

#kwh-member-details-fields .kwh-form-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 16px 20px !important;
    margin-bottom: 16px !important;
}

#kwh-member-details-fields .kwh-form-group {
    margin-bottom: 0 !important;
}

#kwh-member-details-fields label {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 6px !important;
}

#kwh-member-details-fields input[type="text"],
#kwh-member-details-fields input[type="date"],
#kwh-member-details-fields select {
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.01) !important;
    height: auto !important;
    transition: all 0.2s ease;
}

#kwh-member-details-fields input[type="text"]:focus,
#kwh-member-details-fields input[type="date"]:focus,
#kwh-member-details-fields select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1) !important;
}

#kwh-player-only-fields {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 16px !important;
    margin-top: 20px !important;
}

#kwh-player-attribs-row {
    gap: 15px !important;
    margin-top: 10px !important;
    padding: 15px !important;
    background: #f1f5f9 !important;
    border-radius: 8px !important;
    border: 1px dashed #cbd5e1 !important;
}

#kwh-player-attribs-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

/* ── SUPER ULTRA COMPACT & ELEGANT GLOBAL UI UX ── */

/* 1. Main Container & Body */
.kwh-form-container {
    max-width: 950px !important; /* Increased width for better content distribution */
    margin-left: auto !important;
    margin-right: auto !important;
    border-radius: 12px !important; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

/* 2. Unified Container (Personal Data + Docs) */
@media (max-width: 768px) {
    #kwh-unified-container {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    #kwh-member-data-col {
        border-left: none !important;
        padding-left: 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding-bottom: 15px !important;
    }
}


.kwh-reg-header {
    background: #f8fafc !important;
    padding: 20px 30px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.kwh-reg-header h2 {
    font-size: 1.3rem !important;
    margin: 0 !important;
    color: #1a365d !important;
}

.kwh-form-body {
    padding: 20px 30px !important;
}

/* 2. INLINE LABELS & COMPACT GROUPS */
.kwh-inline-group {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    margin-bottom: 12px !important;
}

.kwh-inline-group label {
    flex: 0 0 140px !important; /* Fixed width for labels to align inputs */
    margin: 0 !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: none !important;
}

.kwh-form-group input:not([type="file"]):not([type="checkbox"]):not([type="radio"]), 
.kwh-form-group select {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    height: 38px !important;
}

/* 3. COMPACT GRID FOR PERSONAL DETAILS (50/50 Pairs) */
.kwh-compact-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    width: 100% !important;
}

.kwh-compact-grid .kwh-form-group {
    display: block !important; /* Vertical inside the 3-col grid */
}

.kwh-compact-grid label {
    font-size: 0.75rem !important;
    margin-bottom: 4px !important;
    display: block !important;
}

/* 4. Section Titles -> Subtle Headers */
.kwh-section-title {
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    color: #334155 !important;
    margin: 25px 0 12px !important;
    padding: 0 !important;
    background: transparent !important;
    border-bottom: 2px solid #e2e8f0 !important;
    width: 100% !important;
    padding-bottom: 4px !important;
}

.kwh-section-title span.dashicons {
    font-size: 1rem !important;
    width: 18px !important;
    height: 18px !important;
}

.kwh-form-section {
    margin-bottom: 20px !important;
}

.kwh-form-section::after { display: none !important; }

/* 5. Temp Player Row - Ultra Thin */
.kwh-temp-player-row:hover {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
}

/* Method Toggle - Inline style */
.kwh-method-label.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* 6. LOOKUP RESULT SYMMETRY & DESIGN */
.kwh-lookup-result-wrapper {
    display: flex !important;
    gap: 12px !important;
    align-items: stretch !important; /* Forces equal height for both cards */
    width: 100% !important;
    margin-top: 15px !important;
    margin-bottom: 5px !important;
}

.kwh-lookup-id-card {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    box-sizing: border-box !important;
}

.kwh-lookup-photo-box {
    width: 64px !important;
    height: 64px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #e0f2fe !important;
    border: 2px solid #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    flex-shrink: 0 !important;
}

.kwh-lookup-photo-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.kwh-lookup-photo-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #0ea5e9 !important;
}

.kwh-lookup-photo-placeholder span {
    color: white !important;
    font-size: 30px !important;
    width: 30px !important;
    height: 30px !important;
}

.kwh-lookup-info-content {
    flex: 1 !important;
}

.kwh-lookup-name {
    font-weight: 900 !important;
    font-size: 1.1rem !important;
    color: #0c4a6e !important;
    margin-bottom: 4px !important;
    line-height: 1.2 !important;
}

.kwh-lookup-club {
    font-size: 0.87rem !important;
    margin-bottom: 2px !important;
}

.kwh-lookup-age {
    /* Styles for the age/category text */
}

.kwh-lookup-stats-container {
    flex: 1 !important;
    display: flex !important; /* Ensures the inner kwh-quota-card can stretch */
    box-sizing: border-box !important;
}

.kwh-quota-card {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}

.kwh-quota-header {
    color: #475569 !important;
    font-weight: 900 !important;
    margin-bottom: 12px !important;
    font-size: 0.8rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 6px !important;
    width: 100% !important;
}

.kwh-quota-body {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    flex: 1 !important;
    width: 100% !important;
}

.kwh-quota-item {
    display: flex !important;
    flex-direction: column !important;
}

.kwh-quota-label {
    color: #64748b !important;
    font-weight: bold !important;
    font-size: 0.75rem !important;
}

.kwh-quota-val {
    font-size: 1.2rem !important;
    color: #1e293b !important;
}

.kwh-quota-sub {
    font-size: 0.7rem !important;
    color: #94a3b8 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.kwh-center { text-align: center !important; }
.kwh-left { text-align: left !important; }
.kwh-left .kwh-quota-val { text-align: left !important; }


.kwh-lookup-no-quota {
    padding: 15px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    color: #64748b !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* ── Club Update Specialized UI ── */
.club-update-form .kwh-reg-header {
    background: #0f172a !important;
    border-bottom: none !important;
}

.club-update-form .kwh-reg-header h2 {
    color: #fff !important;
    font-weight: 900 !important;
}

.club-update-form .kwh-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kwh-kit-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.kwh-kit-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1);
}

.kwh-kit-card h4 {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 15px !important;
}

.kwh-ag-kit-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 15px;
    position: relative;
    transition: background 0.3s ease;
}

.kwh-ag-kit-box:hover {
    background: #f1f5f9;
}

.kwh-sync-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.kwh-sync-toggle input {
    margin: 0;
    cursor: pointer;
}

.kwh-sync-toggle:hover {
    background: #3b82f6;
    color: #ffffff;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 1px #cbd5e1;
}
