/* Reformix User Dashboard - Professional CSS */
.reformix-pro-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 80vh;
}

.reformix-pro-dashboard * {
    box-sizing: border-box;
}

/* SEO Hidden Elements */
.seo-friendly-title,
.seo-friendly-description {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, var(--reformix-primary-color, #94d307) 0%, #94d307 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-info h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
}

.user-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Navigation */
.dashboard-nav {
    display: flex;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    gap: 4px;
}

.dashboard-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: #64748b;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.dashboard-nav .nav-item:hover {
    background: #f1f5f9;
    color: #334155;
}

.dashboard-nav .nav-item.active {
    background: var(--reformix-primary-color, #667eea);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.dashboard-nav .nav-item i {
    font-size: 16px;
}

.dashboard-nav .nav-item .unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-nav .nav-item.logout {
    margin-left: auto;
    color: #ef4444;
}

.dashboard-nav .nav-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Dashboard Content */
.dashboard-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-content h2 {
    margin: 0 0 25px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.dashboard-content h3 {
    margin: 30px 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #334155;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--reformix-primary-color, #667eea), #764ba2);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--reformix-primary-color, #667eea);
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Job Cards */
.job-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--reformix-primary-color, #667eea);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.job-id {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--reformix-primary-color, #667eea);
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-waiting {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-visited {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.status-budgeted {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.status-pending {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.status-done {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Job Details */
.job-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.job-detail {
    display: flex;
    flex-direction: column;
}

.job-detail label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.job-detail span {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

/* Job Actions */
.job-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--reformix-primary-color, #667eea);
    color: #fff;
    border-color: var(--reformix-primary-color, #667eea);
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn i {
    font-size: 14px;
}

.unread-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* Profile Form */
.profile-form {
    max-width: 800px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.form-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}

.form-section h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

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

.form-field input:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.form-field small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* Profile Picture Upload */
.profile-picture-upload {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-picture-upload .current-avatar {
    flex-shrink: 0;
}

.profile-picture-upload .current-avatar img {
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    object-fit: cover;
}

.profile-picture-upload input[type="file"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.profile-picture-upload input[type="file"]:hover {
    border-color: var(--reformix-primary-color, #667eea);
    background: #f0f9ff;
}

@media (max-width: 768px) {
    .profile-picture-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-picture-upload input[type="file"] {
        min-width: 100%;
    }
}

.btn-save {
    background: var(--reformix-primary-color, #667eea);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Notices */
.notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.notice.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.notice.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Dashboard Chat Styles */
.reformix-chat-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: 500px;
    display: flex;
    flex-direction: column;
}

.reformix-chat-header {
    background: linear-gradient(135deg, var(--reformix-primary-color, #667eea) 0%, var(--reformix-primary-dark, #764ba2) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.reformix-chat-header .chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.reformix-chat-header .chat-info {
    flex: 1;
}

.reformix-chat-header .chat-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.reformix-chat-header .chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reformix-chat-header .chat-status.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.reformix-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.reformix-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.reformix-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.reformix-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}

.reformix-chat-form {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 8px;
    gap: 8px;
    transition: border-color 0.2s;
    width: 100%;
}

.chat-input-wrapper:focus-within {
    border-color: var(--reformix-primary-color, #667eea);
    background: white;
}

.chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    resize: none;
    outline: none;
    font-size: 16px;
    line-height: 1.5;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    overflow: hidden;
    font-family: inherit;
    width: 0;
    min-width: 0;
}

.chat-input-wrapper textarea::placeholder {
    color: #9ca3af;
}

.chat-input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.chat-attach-btn, .chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.chat-attach-btn {
    background: var(--wp-admin-theme-color, #0073aa);
    color: white;
}

.chat-attach-btn:hover {
    background: var(--wp-admin-theme-color-darker-10, #005a87);
    color: white;
}

.chat-send-btn {
    background: var(--wp-admin-theme-color, #0073aa);
    color: white;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-attach-btn .dashicons,
.chat-send-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: block;
}

.chat-attach-btn:empty:before {
    content: "\f317";
    font-family: dashicons;
    font-size: 16px;
}

.chat-send-btn:empty:before {
    content: "\f139";
    font-family: dashicons;
    font-size: 16px;
}

/* File Preview in Dashboard Chat */
.reformix-chat-form .file-preview {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 8px;
    animation: slideDown 0.3s ease-out;
}

.reformix-chat-form .file-preview .file-name {
    flex: 1;
    font-size: 13px;
    color: #374151;
    word-break: break-all;
}

.reformix-chat-form .file-preview .remove-preview {
    background: #ef4444;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
}

/* Dashboard Chat Loading */
.reformix-chat-messages .chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
}

.reformix-chat-messages .loading-dots {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.reformix-chat-messages .loading-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.reformix-chat-messages .loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.reformix-chat-messages .loading-dots span:nth-child(2) { animation-delay: -0.16s; }

/* Dashboard Chat Empty State */
.reformix-chat-messages .chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
}

/* Dashboard Chat Messages */
.reformix-chat-messages .chat-message {
    display: flex;
    margin-bottom: 8px;
    animation: messageSlide 0.3s ease-out;
}

.reformix-chat-messages .chat-message.user {
    justify-content: flex-end;
}

.reformix-chat-messages .chat-message.admin {
    justify-content: flex-start;
}

/* File Messages Without Background */
.reformix-chat-messages .chat-message.file-message .message-content-no-bg {
    max-width: 75%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

.reformix-chat-messages .message-content-no-bg {
    max-width: 75%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

/* File Attachments Without Background */
.image-attachment-no-bg,
.video-attachment-no-bg,
.file-attachment-no-bg {
    background: transparent;
    border: none;
    padding: 0;
}

/* File Preview in Chat */
.file-preview-message .message-content-no-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.1);
    padding: 8px 12px;
    border-radius: 8px;
}

.file-preview-info .file-name {
    font-size: 13px;
    color: #374151;
}

.file-preview-info .remove-preview {
    background: #ef4444;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.file-preview-icon {
    font-size: 48px;
    color: #6b7280;
}

.reformix-chat-messages .message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.reformix-chat-messages .chat-message.user .message-bubble {
    background: linear-gradient(135deg, var(--reformix-primary-color, #667eea) 0%, var(--reformix-primary-dark, #764ba2) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.reformix-chat-messages .chat-message.admin .message-bubble {
    background: white;
    color: #374151;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.reformix-chat-messages .message-bubble p {
    margin: 0;
    line-height: 1.4;
}

.reformix-chat-messages .message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.reformix-chat-messages .chat-message.admin .message-time {
    text-align: left;
}

/* Dashboard Chat Back Link */
.chat-back-link {
    margin-bottom: 20px;
}

.chat-back-link .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--reformix-primary-color, #667eea);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chat-back-link .btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .reformix-pro-dashboard {
        margin: 10px;
        padding: 0;
    }
    
    /* Dashboard Chat Mobile */
    .reformix-chat-container {
        height: 400px;
    }
    
    .reformix-chat-header {
        padding: 12px 16px;
    }
    
    .reformix-chat-header .chat-info h4 {
        font-size: 14px;
    }
    
    .reformix-chat-header .chat-status {
        font-size: 11px;
    }
    
    .reformix-chat-messages {
        padding: 12px;
    }
    
    .reformix-chat-messages .message-bubble {
        max-width: 85%;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .reformix-chat-form {
        padding: 12px;
    }
    
    .chat-input-wrapper {
        border-radius: 20px;
    }
    
    .chat-input-wrapper textarea {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 18px;
        max-height: 80px;
    }
    
    .chat-input-actions {
        padding: 6px 10px 6px 0;
        gap: 6px;
    }
    
    .chat-attach-btn, .chat-send-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .dashboard-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .user-welcome {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .dashboard-nav {
        padding: 6px;
        margin-bottom: 20px;
    }
    
    .dashboard-nav .nav-item {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .dashboard-nav .nav-item span {
        display: none;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .dashboard-content h2 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .job-card {
        padding: 20px;
    }
    
    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .job-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .job-actions {
        justify-content: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-nav .nav-item {
        padding: 8px 10px;
    }
    
    .job-id {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Dashboard Chat Extra Small Screens */
    .reformix-chat-container {
        height: 350px;
    }
    
    .reformix-chat-header {
        padding: 10px 12px;
    }
    
    .reformix-chat-header .chat-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .reformix-chat-header .chat-info h4 {
        font-size: 13px;
    }
    
    .reformix-chat-messages {
        padding: 8px;
    }
    
    .reformix-chat-messages .message-bubble {
        max-width: 90%;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .reformix-chat-form {
        padding: 8px;
    }
    
    .chat-input-wrapper textarea {
        padding: 8px 10px;
        font-size: 13px;
        min-height: 16px;
        max-height: 60px;
    }
    
    .chat-attach-btn, .chat-send-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}