/* Client Management Plugin Admin Styles - COMPLETE WITH SSN TOGGLE */

.client-management-wrap {
    margin: 20px 0;
}

.client-management-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 20px 0;
}

.client-management-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-management-header h1 {
    font-size: 24px !important;
    margin: 0 !important;
    color: #ffffff !important; /* FIXED: Changed to white with !important */
    text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; /* ADDED: Text shadow for better readability */
}

.client-management-header-actions {
    display: flex;
    gap: 15px;
}

.client-management-header-actions .button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.client-management-header-actions .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.client-management-header-actions .button-secondary {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.client-management-content {
    padding: 30px;
}

.client-management-user-session {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-status-badge.admin {
    background: #e8f5e8;
    color: #4caf50;
}

.admin-status-badge.user {
    background: #fff3cd;
    color: #856404;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #667eea;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.client-management-search-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
}

.search-grid input,
.search-grid select {
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
}

.search-grid input:focus,
.search-grid select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#clientsTable {
    margin-top: 20px;
}

#clientsTable th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.pagination-wrapper {
    text-align: center;
    margin-top: 20px;
}

#pagination {
    display: inline-flex;
    gap: 10px;
}

#pagination button {
    padding: 8px 16px;
    border: 1px solid #e1e8ed;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#pagination button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e8f5e8;
    color: #4caf50;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.incomplete {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.unknown {
    background: #e9ecef;
    color: #6c757d;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons .button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    min-height: auto;
    line-height: 1;
}

/* Modal styles */
.client-management-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #34495e;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer {
    text-align: right;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.modal-footer .button {
    margin-left: 10px;
}

/* Client form specific styles */
.client-form-container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.client-form-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 30px;
    text-align: center;
}

.client-form-header h1 {
    font-size: 24px !important;
    margin-bottom: 10px !important;
    color: #ffffff !important; /* FIXED: Ensure client form headers are also white */
    text-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; /* ADDED: Text shadow for client form headers */
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e1e8ed;
    border-radius: 3px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.client-form-content {
    padding: 40px;
}

.form-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.form-section-main {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.section-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.file-upload {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #5a67d8;
    background: #f0f4ff;
}

.file-upload input {
    display: none;
}

.generated-field {
    background-color: #e8f5e8;
    border-color: #4caf50;
}

/* FIXED: SSN TOGGLE STYLES - Improved positioning and interaction */
.ssn-input-container {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
}

.ssn-input-container #ssn {
    flex: 1 !important;
    padding-right: 50px !important;
    box-sizing: border-box !important;
}

#toggleSSN {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #dee2e6 !important;
    cursor: pointer !important;
    font-size: 16px !important;
    color: #666 !important;
    z-index: 100 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    width: auto !important;
    height: auto !important;
    min-width: 32px !important;
    min-height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    user-select: none !important;
}

#toggleSSN:hover {
    background-color: #f8f9fa !important;
    color: #333 !important;
    border-color: #adb5bd !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

#toggleSSN:focus {
    outline: 2px solid #667eea !important;
    outline-offset: 1px !important;
    background-color: #fff !important;
}

#toggleSSN:active {
    transform: translateY(-50%) scale(0.95) !important;
}

#ssn[style*="background-color: rgb(255, 243, 205)"] {
    border-left: 4px solid #ffc107 !important;
}

.ssn-help-text {
    color: #666 !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    display: block !important;
    font-style: italic !important;
}

.ssn-notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: #d4edda !important;
    color: #155724 !important;
    padding: 12px 18px !important;
    border: 1px solid #c3e6cb !important;
    border-radius: 6px !important;
    z-index: 9999 !important;
    font-size: 14px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    animation: slideInRight 0.3s ease !important;
    max-width: 300px !important;
    word-wrap: break-word !important;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Progress report styles */
.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-circle svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.progress-circle .progress-ring {
    fill: none;
    stroke: #e1e8ed;
    stroke-width: 8;
}

.progress-circle .progress-fill {
    fill: none;
    stroke: #667eea;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.client-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    overflow: hidden;
}

.client-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-info {
    flex: 1;
}

.client-name {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.client-details {
    color: #7f8c8d;
    font-size: 14px;
}

.client-body {
    padding: 25px;
}

.progress-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.breakdown-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.section-percentage {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e8ed;
}

.progress-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: #34495e;
}

.item-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-small {
    width: 100px;
    height: 6px;
    background: #e1e8ed;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #45a049);
    transition: width 0.3s ease;
}

.progress-value {
    font-size: 12px;
    color: #7f8c8d;
    min-width: 35px;
    text-align: right;
}

.sportsbooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.sportsbook-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
}

.sportsbook-name {
    font-weight: 500;
    color: #34495e;
    text-transform: capitalize;
    font-size: 14px;
}

.stage-indicator {
    display: flex;
    gap: 3px;
    align-items: center;
}

.stage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e1e8ed;
    transition: background 0.3s ease;
}

.stage-dot.active {
    background: #4caf50;
}

.stage-dot.current {
    background: #ff9800;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.stage-text {
    margin-left: 8px;
    font-size: 12px;
    color: #7f8c8d;
}

.status-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
    margin-right: 8px;
}

.status-complete {
    background: #4caf50;
}

.status-incomplete {
    background: #f44336;
}

.status-pending {
    background: #ff9800;
}

/* Responsive design */
@media (max-width: 768px) {
    .client-management-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .client-management-header-actions {
        justify-content: center;
    }
    
    .search-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-grid,
    .form-grid-main {
        grid-template-columns: 1fr;
    }
    
    .progress-breakdown {
        grid-template-columns: 1fr;
    }
    
    .client-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .client-management-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    /* FIXED: SSN Responsive Styles - Better mobile handling */
    .ssn-input-container {
        position: relative !important;
    }
    
    #toggleSSN {
        position: absolute !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 6px 10px !important;
        font-size: 14px !important;
        min-width: 36px !important;
        min-height: 32px !important;
    }
    
    .ssn-input-container #ssn {
        padding-right: 55px !important;
    }
}

/* WordPress admin compatibility */
.wp-admin .client-management-wrap {
    margin-top: 0;
}

.wp-admin .client-management-container {
    margin: 0;
}

/* Override WordPress table styles for better appearance */
#clientsTable.wp-list-table {
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#clientsTable.wp-list-table th {
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

#clientsTable.wp-list-table td {
    border-left: none;
    border-right: none;
}

#clientsTable.wp-list-table .striped > tbody > :nth-child(odd),
#clientsTable.wp-list-table .striped > tbody > :nth-child(odd) th,
#clientsTable.wp-list-table .striped > tbody > :nth-child(odd) td {
    background-color: #f8f9fa;
}

/* Loading and error states */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #f44336;
    margin: 20px 0;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
    margin: 20px 0;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}