/* Modern Representative Login Styles */

.representative-login-modern {
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    font-family: 'Vazir', 'IRANSans', Arial, sans-serif;
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #58992e 0%, #6c757d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(88, 153, 46, 0.3);
}

.login-icon .dashicons {
    font-size: 40px;
    color: white;
    line-height: 1;
    vertical-align: middle;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header h2 {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.login-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Form Styles */
.representative-login-form-modern {
    margin-bottom: 30px;
}

.form-group-modern {
    margin-bottom: 25px;
    position: relative;
}

.form-group-modern label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #333 !important;
    font-weight: 600;
    font-size: 14px;
}

.form-group-modern label .dashicons {
    color: #58992e;
    font-size: 18px;
}

.input-modern {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #333;
}

.input-modern:focus {
    outline: none;
    border-color: #58992e;
    background: white;
    box-shadow: 0 0 0 3px rgba(88, 153, 46, 0.1);
    transform: translateY(-2px);
}

.input-modern.focused {
    border-color: #58992e;
    background: white;
}

.input-help {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.input-help .dashicons {
    color: #58992e;
    font-size: 16px;
}

/* Button Styles */
.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #58992e 0%, #6c757d 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(88, 153, 46, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary-modern:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 153, 46, 0.4);
}

.btn-primary-modern:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.btn-loading .dashicons {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Message Styles */
.message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: slideInDown 0.3s ease;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message .dashicons {
    font-size: 18px;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Success State */
.representative-login-success {
    text-align: center;
    padding: 40px;
}

.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 20px;
    padding: 40px;
    border: 2px solid #28a745;
}

.success-message .dashicons {
    font-size: 60px;
    color: #28a745;
    margin-bottom: 20px;
}

.success-message h3 {
    margin: 0 0 15px 0;
    color: #155724;
    font-size: 24px;
    font-weight: 600;
}

.success-message p {
    margin: 0 0 25px 0;
    color: #155724;
    font-size: 16px;
}

/* Debug Info */
.login-debug-info {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.login-debug-info summary {
    cursor: pointer;
    font-weight: 600;
    color: #58992e;
    margin-bottom: 15px;
}

.login-debug-info summary:hover {
    color: #6c757d;
}

.debug-content {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.debug-content p {
    margin: 5px 0;
}

/* Help Section */
.login-help {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 1px solid #e9ecef;
}

.login-help h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.login-help ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-help li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #666;
    font-size: 14px;
}

.login-help li .dashicons {
    color: #58992e;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .representative-login-modern {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
    
    .login-header p {
        font-size: 14px;
    }
    
    .input-modern {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .btn-primary-modern {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .representative-login-modern {
        margin: 10px;
        padding: 20px 15px;
    }
    
    .login-icon {
        width: 60px;
        height: 60px;
    }
    
    .login-icon .dashicons {
        font-size: 30px;
    }
    
    .login-header h2 {
        font-size: 20px;
    }
    
    .input-modern {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .representative-login-modern {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .login-header h2 {
        color: #e2e8f0;
    }
    
    .login-header p {
        color: #a0aec0;
    }
    
    .form-group-modern label {
        color: #e2e8f0 !important;
    }
    
    .input-modern {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .input-modern:focus {
        background: #2d3748;
        border-color: #58992e;
    }
    
    .login-help {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        border-color: #4a5568;
    }
    
    .login-help h4 {
        color: #e2e8f0;
    }
    
    .login-help li {
        color: #a0aec0;
    }
}

/* Loading States */
.form-group-modern.loading .input-modern {
    background: #f8f9fa;
    border-color: #58992e;
}

.form-group-modern.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #58992e;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Focus Effects */
.form-group-modern.focused label {
    color: #58992e;
}

.form-group-modern.focused .input-help {
    color: #58992e;
}

/* Error States */
.form-group-modern.error .input-modern {
    border-color: #dc3545;
    background: #fff5f5;
}

.form-group-modern.error .input-help {
    color: #dc3545;
}

.form-group-modern.error label {
    color: #dc3545;
}

/* Success States */
.form-group-modern.success .input-modern {
    border-color: #28a745;
    background: #f8fff9;
}

.form-group-modern.success .input-help {
    color: #28a745;
}

.form-group-modern.success label {
    color: #28a745;
}

/* OTP Verification Styles */
.login-step {
    transition: all 0.3s ease;
}

.otp-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 15px;
    border: 2px solid #e3f2fd;
}

.otp-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.otp-icon .dashicons {
    font-size: 30px;
    color: white;
}

.otp-info h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2e7d32;
}

.otp-info p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.otp-timer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 8px 15px;
    display: inline-block;
}

.otp-timer span {
    color: #856404;
    font-weight: 600;
    font-size: 14px;
}

#otp-countdown {
    color: #d63031;
    font-weight: 700;
}

.otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

/* Dynamic OTP input styling based on length */
.otp-input[data-otp-length="4"] {
    letter-spacing: 12px;
    font-size: 28px;
}

.otp-input[data-otp-length="5"] {
    letter-spacing: 10px;
    font-size: 26px;
}

.otp-input[data-otp-length="6"] {
    letter-spacing: 0px;
    font-size: 16px;
}

.otp-input[data-otp-length="7"] {
    letter-spacing: 6px;
    font-size: 22px;
}

.otp-input[data-otp-length="8"] {
    letter-spacing: 4px;
    font-size: 20px;
}

.btn-secondary-modern {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
}

.btn-link-modern {
    background: none;
    color: #58992e;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-link-modern:hover {
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
}

/* OTP Step Transitions */
.login-step.hidden {
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
}

.login-step.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Loading States */
.btn-loading {
    display: none !important;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Success Animation */
.otp-success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Error States */
.otp-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Responsive Design for OTP */
@media (max-width: 768px) {
    .otp-input {
        font-size: 20px;
        letter-spacing: 6px;
    }
    
    .otp-input[data-otp-length="4"] {
        letter-spacing: 8px;
        font-size: 24px;
    }
    
    .otp-input[data-otp-length="5"] {
        letter-spacing: 7px;
        font-size: 22px;
    }
    
    .otp-input[data-otp-length="6"] {
        letter-spacing: 6px;
        font-size: 20px;
    }
    
    .otp-input[data-otp-length="7"] {
        letter-spacing: 5px;
        font-size: 18px;
    }
    
    .otp-input[data-otp-length="8"] {
        letter-spacing: 4px;
        font-size: 16px;
    }
    
    .otp-info {
        padding: 15px;
    }
    
    .otp-icon {
        width: 50px;
        height: 50px;
    }
    
    .otp-icon .dashicons {
        font-size: 25px;
    }
}

/* Fix for send-otp-btn - white text and border with border-radius */
#send-otp-btn {
    color: white !important;
    border: 2px solid white !important;
    border-radius: 12px !important;
}

#send-otp-btn:hover {
    color: white !important;
    border-color: white !important;
    background: linear-gradient(135deg, #4a7c59 0%, #5a6c7d 100%) !important;
}

/* Fix for back-to-customer-code button (تغییر کد مشتری) hover - similar to other buttons */
#back-to-customer-code:hover {
    background: linear-gradient(135deg, #58992e 0%, #6c757d 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 153, 46, 0.4);
}

/* Fix for view-details-btn - white text in both normal and hover states */
.view-details-btn,
.view-details-btn:hover {
    color: white !important;
}

/* Additional fixes for other buttons with white text issues */
.btn-modern,
.btn-modern:hover,
.action-btn,
.action-btn:hover,
button[class*="btn-"],
button[class*="btn-"]:hover {
    color: white !important;
}

/* Specific fix for shipment details button */
.shipment-actions-modern .btn,
.shipment-actions-modern .btn:hover {
    color: white !important;
}

/* Fix for representative dashboard buttons */
.representative-dashboard .btn,
.representative-dashboard .btn:hover,
.representative-dashboard button,
.representative-dashboard button:hover {
    color: white !important;
}

/* Product status styles for shipment details modal */
.product-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

/* استفاده نشده - آبی روشن */
.product-status.inactive {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border-color: #90caf9;
}

/* استفاده شده - سبز */
.product-status.active {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-color: #81c784;
}

/* ارسال شده - بنفش */
.product-status.sent {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #7b1fa2;
    border-color: #ce93d8;
}

/* تحویل شده - نارنجی */
.product-status.delivered {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    color: #ef6c00;
    border-color: #ffb74d;
}

/* در بررسی - قرمز روشن */
.product-status.reviewing {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-color: #ef5350;
}

/* منتظر قطعه - زرد */
.product-status.waiting-part {
    background: linear-gradient(135deg, #fffde7 0%, #fff9c4 100%);
    color: #f57f17;
    border-color: #ffeb3b;
}

/* تکمیل شده - سبز تیره */
.product-status.completed {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    color: #00695c;
    border-color: #4db6ac;
}

/* در انتظار تایید - آبی */
.product-status.pending-approval {
    background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
    color: #0277bd;
    border-color: #29b6f6;
}

/* تایید شده - سبز روشن */
.product-status.approved {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #388e3c;
    border-color: #66bb6a;
}

/* لغو شده - قرمز */
.product-status.cancelled {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #d32f2f;
    border-color: #ef5350;
}

/* وضعیت 7 - سبز روشن */
.product-status.status-7 {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-color: #81c784;
}

/* وضعیت 8 - صورتی */
.product-status.status-8 {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
    color: #c2185b;
    border-color: #e91e63;
}

/* وضعیت 9 - نارنجی */
.product-status.status-9 {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
    color: #f57c00;
    border-color: #ff9800;
}