/**
 * Public styles for Odoo Helpdesk Integration
 */

/* Screen reader text - visually hidden but available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.odoo-helpdesk-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
}

/* Form styling */
#odoo-helpdesk-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.odoo-helpdesk-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
}

.odoo-form-group {
    margin-bottom: 20px;
}

.odoo-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.odoo-form-group label .required {
    color: #d63638;
}

.odoo-form-group input[type="text"],
.odoo-form-group input[type="email"],
.odoo-form-group input[type="tel"],
.odoo-form-group textarea,
.odoo-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Fix for the label styling consistency */
.odoo-form-group label,
.odoo-form-group .form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* Fix for radio button vertical alignment */
.odoo-radio-group .odoo-radio-option {
    display: flex;
    align-items: center; /* This ensures vertical centering */
}

.odoo-radio-group .odoo-radio-option input[type="radio"] {
    margin-right: 10px;
    margin-top: 0; /* Remove any default top margin */
    margin-bottom: 0; /* Remove any default bottom margin */
}

/* Some browsers might need these additional styles */
.odoo-radio-group .odoo-radio-option label {
    display: inline-block; /* Keep labels inline with inputs */
    margin-bottom: 0; /* Remove bottom margin to prevent alignment issues */
    line-height: normal; /* Use normal line height for better alignment */
    font-weight: 400;
}

/* Focus styles for better keyboard navigation */
.odoo-form-group input[type="text"]:focus,
.odoo-form-group input[type="email"]:focus,
.odoo-form-group input[type="tel"]:focus,
.odoo-form-group textarea:focus,
.odoo-form-group select:focus,
.odoo-form-group input[type="radio"]:focus,
.odoo-form-group input[type="file"]:focus,
.odoo-form-submit:focus {
    outline: 2px solid #2271b1;
    outline-offset: 1px;
}

.odoo-form-group textarea {
    min-height: 120px;
}

/* File upload styling */
.odoo-file-upload {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #fff;
}

.odoo-file-upload label {
    display: block;
    cursor: pointer;
    margin-bottom: 10px;
}

.odoo-file-upload input[type="file"] {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

.odoo-file-button {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-weight: 500;
    margin-top: 10px;
    cursor: pointer;
}

.odoo-file-button:hover {
    background: #e5e5e5;
}

.odoo-file-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.odoo-file-item:last-child {
    border-bottom: none;
}

.odoo-file-item .file-name {
    flex: 1;
    word-break: break-all;
}

.odoo-file-item .file-size {
    padding: 0 10px;
    color: #666;
    font-size: 0.9em;
}

.odoo-file-item .file-error {
    color: #d63638;
    margin-left: 10px;
    font-size: 0.9em;
}

.odoo-file-item.invalid {
    background-color: #ffecec;
}

.odoo-file-remove {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    min-height: 20px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: normal;
    padding: 0;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.odoo-file-remove:hover {
    background-color: #c0392b;
}

/* Radio button styling */
.odoo-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.odoo-radio-group .odoo-radio-option {
    display: flex;
    align-items: center;
}

.odoo-radio-group .odoo-radio-option input[type="radio"] {
    margin-right: 10px;
}

/* Submit button */
.odoo-form-submit {
    background-color: var(--fs-color-primary);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.odoo-form-submit:hover {
    box-shadow: inset 0 0 0 100px rgba(0, 0, 0, .2);
}

.odoo-form-submit:disabled {
    background-color: #ddd;
    cursor: not-allowed;
}

/* Message styling */
.odoo-form-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    display: none;
}

.odoo-success-message {
    background-color: #ecf8ed;
    border: 1px solid #c9e3cc;
    color: #155724;
}

.odoo-error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Loading indicator */
.odoo-loading-indicator {
    display: none;
    text-align: center;
    padding: 10px;
}

.odoo-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--fs-color-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* reCAPTCHA styling */
.g-recaptcha {
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 300px) {
    .g-recaptcha {
        transform: scale(0.77);
        transform-origin: 0 0;
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #odoo-helpdesk-form {
        padding: 15px;
    }
    
    .odoo-form-row {
        flex-direction: column;
    }
    
    .odoo-form-column {
        width: 100%;
        padding: 0;
    }
}