/* MN Affiliate Shortcodes Styles */

/* General shortcode container styles */
.mn-affiliate-id,
.mn-affiliate-username,
.mn-affiliate-referral-url,
.mn-affiliate-info,
.mn-affiliate-stats,
.mn-affiliate-earnings {
    display: inline-block;
    font-family: inherit;
    line-height: 1.4;
}

/* Label styles */
.mn-affiliate-label,
.mn-earnings-label {
    font-weight: 600;
    color: #333;
    margin-right: 4px;
}

/* Value styles */
.mn-affiliate-id-value,
.mn-affiliate-username-value,
.mn-referral-url-value,
.mn-earnings-value {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    font-size: 0.9em;
}

/* Specific styling for affiliate URL value */
.mn-affiliate-url-value {
    display: inline-block;
    padding: 10px;
    border: 3px dashed #1F80FF;
    border-radius: 15px;
    margin-bottom: 10px;
    color: #1F80FF;
    background: white;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* Action buttons container */
.mn-affiliate-actions {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
    align-items: center;
}

/* Base button styles */
.mn-copy-btn,
.mn-edit-btn {
    background: white;
    color: #1F80FF;
    border: 1px solid white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 32px;
}

.mn-copy-btn:hover,
.mn-edit-btn:hover {
    border-color: #1F80FF;
    color: #1F80FF;
    transform: translateY(-1px);
}

.mn-copy-btn.success {
    background: #46b450;
    color: white;
    border-color: #46b450;
}

.mn-copy-btn.error {
    background: #dc3232;
    color: white;
    border-color: #dc3232;
}

/* Icon styles */
.mn-action-icon,
.mn-copy-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.mn-copy-text,
.mn-edit-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Modal styles */
.mn-edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mn-edit-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.mn-edit-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mn-edit-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.mn-edit-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mn-edit-modal-close:hover {
    color: #333;
}

.mn-edit-modal-body {
    padding: 20px;
}

.mn-edit-modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.mn-edit-modal-body input[type="url"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.mn-edit-modal-body input[type="url"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.mn-edit-help {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.mn-edit-modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.mn-edit-cancel,
.mn-edit-save {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mn-edit-cancel {
    background: white;
    color: #666;
}

.mn-edit-cancel:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.mn-edit-save {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.mn-edit-save:hover {
    background: #005a87;
    border-color: #005a87;
}

.mn-edit-save:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Success message */
.mn-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #46b450;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    font-size: 14px;
}

/* Share button container */
.mn-share-container {
    margin-top: 15px;
    text-align: center;
}

/* Share button styles */
.mn-share-btn {
    background: #1F80FF;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
    box-shadow: 0 2px 8px rgba(31, 128, 255, 0.3);
}

.mn-share-btn:hover {
    background: #0066E6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 128, 255, 0.4);
}

.mn-share-text {
    font-weight: 600;
    white-space: nowrap;
}

/* Share modal styles */
.mn-share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mn-share-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.mn-share-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.mn-share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.mn-share-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mn-share-modal-close:hover {
    color: #333;
}

.mn-share-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.mn-form-group {
    margin-bottom: 20px;
}

.mn-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.mn-form-group input[type="email"],
.mn-form-group input[type="text"],
.mn-form-group input[type="url"],
.mn-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.mn-form-group input[type="url"][readonly] {
    background: #f8f9fa;
    color: #666;
}

.mn-form-group input:focus,
.mn-form-group textarea:focus {
    outline: none;
    border-color: #1F80FF;
    box-shadow: 0 0 0 2px rgba(31, 128, 255, 0.1);
}

.mn-form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.mn-share-modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
}

.mn-share-cancel,
.mn-share-send {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.mn-share-cancel {
    background: white;
    color: #666;
}

.mn-share-cancel:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.mn-share-send {
    background: #1F80FF;
    color: white;
    border-color: #1F80FF;
}

.mn-share-send:hover {
    background: #0066E6;
    border-color: #0066E6;
}

.mn-share-send:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Referral link styles */
.mn-referral-link {
    color: #007cba;
    text-decoration: none;
    word-break: break-all;
}

.mn-referral-link:hover {
    text-decoration: underline;
}

/* Affiliate URL link styles */
.mn-affiliate-url-link {
    display: inline-block;
    padding: 10px;
    border: 3px solid #1F80FF;
    border-radius: 15px;
    margin-bottom: 10px;
    color: #1F80FF;
    text-decoration: none;
    word-break: break-all;
    transition: all 0.3s ease;
}

.mn-affiliate-url-link:hover {
    background-color: #1F80FF;
    color: white;
    text-decoration: none;
}

/* Referral button styles */
.mn-referral-button {
    background: #007cba;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease;
}

.mn-referral-button:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Affiliate info container */
.mn-affiliate-info {
    display: block;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin: 8px 0;
}

.mn-affiliate-info span {
    display: inline-block;
    margin-right: 8px;
}

/* Info item styles */
.mn-info-id,
.mn-info-username,
.mn-info-email,
.mn-info-status,
.mn-info-rate {
    padding: 4px 8px;
    border-radius: 3px;
    margin: 2px 4px;
}

.mn-info-id {
    background: #e3f2fd;
    color: #1565c0;
}

.mn-info-username {
    background: #f3e5f5;
    color: #7b1fa2;
}

.mn-info-email {
    background: #e8f5e8;
    color: #2e7d32;
}

.mn-info-status {
    font-weight: 600;
}

.mn-status-active {
    background: #d4edda;
    color: #155724;
}

.mn-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

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

.mn-info-rate {
    background: #fff3e0;
    color: #ef6c00;
}

/* Stats container */
.mn-affiliate-stats {
    display: block;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin: 8px 0;
    text-align: center;
}

.mn-affiliate-stats span {
    display: inline-block;
    margin: 0 12px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    backdrop-filter: blur(10px);
}


/* Earnings display */
.mn-affiliate-earnings {
    font-size: 1.1em;
    font-weight: 600;
}

.mn-earnings-value {
    color: #28a745;
    font-family: 'Courier New', monospace;
}

/* Referral statistics display */
.mn-affiliate-referral-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.mn-stat-item {
    text-align: left;
    padding: 15px;
    background: #fff;    
    min-width: 120px;
    flex: 1;
    
}

.mn-stat-number {
    font-size: 48px;
    font-weight: bold;
    line-height: 1;
    color: #0B0F19;
    margin-bottom: 5px;
}

.mn-stat-earnings {
    font-size: 18px;
    font-weight: 600;
    color: #0B0F19;
    margin-bottom: 5px;
}

.mn-stat-label {
    font-size: 14px;
    color: #0B0F19;
    font-weight: 500;
	text-transform:uppercase;
    line-height: 1.2;
}

/* Responsive design for stats */
@media (max-width: 768px) {
    .mn-affiliate-referral-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .mn-stat-item {
        min-width: auto;
    }
    
    .mn-stat-number {
        font-size: 36px;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .mn-affiliate-info,
    .mn-affiliate-stats {
        padding: 8px;
    }
    
    .mn-affiliate-info span,
    .mn-affiliate-stats span {
        display: block;
        margin: 4px 0;
    }
    
    .mn-copy-btn {
        margin-left: 0;
        margin-top: 4px;
        display: block;
        width: fit-content;
    }
    
    .mn-referral-url-value {
        word-break: break-all;
        display: block;
        margin-bottom: 4px;
    }
}

/* Animation for copy feedback */
@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.mn-copy-btn.copied {
    animation: copySuccess 0.3s ease;
}

/* Tooltip styles */
.mn-copy-btn[title] {
    position: relative;
}

.mn-copy-btn[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 4px;
}

.mn-copy-btn[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Loading state */
.mn-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error state */
.mn-error {
    color: #dc3545;
    font-style: italic;
}

/* Success state */
.mn-success {
    color: #28a745;
    font-weight: 600;
}

/* Non-affiliate message styles */
.mn-non-affiliate-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    color: #856404;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.mn-non-affiliate-message::before {
    content: "ℹ️";
    margin-right: 8px;
    font-size: 1.1em;
}

/* Alternative message styles */
.mn-non-affiliate-message.info {
    background: #d1ecf1;
    border-color: #bee5eb;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.mn-non-affiliate-message.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    border-left-color: #f39c12;
    color: #856404;
}

.mn-non-affiliate-message.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    border-left-color: #dc3545;
    color: #721c24;
}

/* Email History Styles */
.mn-affiliate-email-history {
    max-width: 800px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mn-email-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e1e1;
}

.mn-email-history-header h4 {
    color: #0B0F19;
    font-size: 20px;
    margin: 0;
    font-weight: 600;
}

.mn-refresh-history-btn {
    background: #1F80FF;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mn-refresh-history-btn:hover {
    background: #0066E6;
    transform: translateY(-1px);
}

.mn-refresh-history-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.mn-refresh-history-btn.mn-refresh-success {
    background: #28a745;
}

.mn-refresh-icon {
    font-size: 14px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.mn-refresh-icon.mn-spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mn-email-history-content {
    position: relative;
}

.mn-email-history-content.mn-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mn-email-history-content.mn-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.mn-email-history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mn-email-history-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mn-email-history-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #ccc;
}

.mn-email-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.mn-email-date {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

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

.mn-status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mn-status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.mn-status-failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mn-email-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mn-email-to,
.mn-email-url,
.mn-referral-info {
    font-size: 14px;
    color: #0B0F19;
    line-height: 1.4;
}

.mn-email-to strong,
.mn-email-url strong,
.mn-referral-info strong {
    color: #333;
    font-weight: 600;
    min-width: 80px;
    display: inline-block;
}

.mn-referral-url {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0073aa;
    word-break: break-all;
    font-size: 13px;
}

.mn-referral-info {
    color: #28a745;
    font-weight: 500;
}

.mn-email-history-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.mn-email-history-empty p {
    color: #666;
    font-size: 16px;
    margin: 0;
    font-style: italic;
}

/* Responsive design for email history */
@media (max-width: 768px) {
    .mn-email-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mn-email-status {
        align-self: flex-start;
    }
    
    .mn-email-details {
        gap: 12px;
    }
    
    .mn-email-to strong,
    .mn-email-url strong,
    .mn-referral-info strong {
        display: block;
        margin-bottom: 4px;
        min-width: auto;
    }
    
    .mn-referral-url {
        display: block;
        margin-top: 4px;
    }
}

/* Error message styles */
.mn-error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3232;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    font-size: 14px;
}

/* Responsive message */
@media (max-width: 768px) {
    .mn-non-affiliate-message {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    .mn-email-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mn-refresh-history-btn {
        align-self: flex-end;
    }
}
