/**
 * Frontend Support CSS - Floating support button and modal styles
 * 
 * Provides styles for the floating support button that appears on the frontend
 * for authenticated contacts with support access permissions.
 */

/* Floating Support Button */
#brightframe-support-button {
    position: fixed;
    bottom: 20px;
    right: 5%;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#brightframe-support-trigger {
    background: linear-gradient(135deg, #ff8536, #18344a);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

#brightframe-support-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #18344a, #ff8536);
}

#brightframe-support-trigger:active {
    transform: translateY(0);
}

.support-icon {
    font-size: 18px;
    line-height: 1;
}

.support-text {
    line-height: 1;
}

/* Support Modal */
#brightframe-support-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.support-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.support-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.support-modal-header {
    background: linear-gradient(135deg, #ff8536, #18344a);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.support-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.support-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Support Form */
#brightframe-support-form {
    padding: 25px;
}

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

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

.support-form-field input,
.support-form-field select,
.support-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.support-form-field input:focus,
.support-form-field select:focus,
.support-form-field textarea:focus {
    outline: none;
    border-color: #ff8536;
    box-shadow: 0 0 0 3px rgba(255, 133, 54, 0.1);
}

.support-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.support-context-info {
    font-size: 12px;
    color: #666;
    background: #f8fafc;
    padding: 10px;
    border-radius: 4px;
    line-height: 1.4;
}

/* Form Actions */
.support-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.support-cancel {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.support-cancel:hover {
    background: #4b5563;
}

.support-submit {
    background: linear-gradient(135deg, #ff8536, #18344a);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.support-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.support-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success State */
.support-form-success {
    padding: 40px 25px;
    text-align: center;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.support-form-success h4 {
    color: #059669;
    font-size: 20px;
    margin-bottom: 15px;
}

.support-form-success p {
    color: #6b7280;
    margin-bottom: 25px;
    line-height: 1.5;
}

.support-form-success button {
    background: #ff8536;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.support-form-success button:hover {
    background: #18344a;
}

/* Loading State */
.support-form-loading {
    padding: 40px 25px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e5e9;
    border-top: 4px solid #ff8536;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.support-form-loading p {
    color: #6b7280;
    font-size: 16px;
}

/* "Not Me" Link */
.support-not-me {
    position: fixed;
    bottom: 80px;
    right: 5%;
    z-index: 99998;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.support-not-me a {
    color: #ff8536;
    text-decoration: none;
}

.support-not-me a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #brightframe-support-button {
        bottom: 15px;
        right: 4%;
    }
    
    #brightframe-support-trigger {
        padding: 12px 16px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .support-icon {
        font-size: 16px;
    }
    
    .support-modal-content {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .support-modal-header {
        padding: 15px 20px;
    }
    
    .support-modal-header h3 {
        font-size: 18px;
    }
    
    #brightframe-support-form {
        padding: 20px;
    }
    
    .support-form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .support-cancel,
    .support-submit {
        width: 100%;
        padding: 14px 24px;
    }
    
    .support-not-me {
        bottom: 65px;
        right: 4%;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .support-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    
    .support-modal-header {
        border-radius: 0;
    }
    
    .support-form-field input,
    .support-form-field select,
    .support-form-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #brightframe-support-trigger {
        border: 2px solid currentColor;
    }
    
    .support-form-field input,
    .support-form-field select,
    .support-form-field textarea {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #brightframe-support-trigger,
    .support-submit,
    .support-cancel,
    .support-modal-close {
        transition: none;
    }
    
    #brightframe-support-trigger:hover {
        transform: none;
    }
    
    .support-submit:hover {
        transform: none;
    }
    
    .support-modal-content {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .support-modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .support-form-field label {
        color: #f9fafb;
    }
    
    .support-form-field input,
    .support-form-field select,
    .support-form-field textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .support-form-field input:focus,
    .support-form-field select:focus,
    .support-form-field textarea:focus {
        border-color: #ff8536;
        background: #374151;
    }
    
    .support-context-info {
        background: #374151;
        color: #d1d5db;
    }
    
    .support-form-actions {
        border-color: #4b5563;
    }
    
    .support-not-me {
        background: rgba(31, 41, 55, 0.95);
        color: #f9fafb;
    }
}