/* WP Simple Guest Chat - forms.css */
/* General styles for form elements if not context-specific */

/* General input field styling (text, password, textarea within chat) */
.wsgc-chat-instance-wrapper .wsgc-input-field, /* Generic class for modal inputs */
.wsgc-chat-instance-wrapper .wsgc-nickname-input, /* Legacy, now for modal */
.wsgc-chat-instance-wrapper .wsgc-message-input, /* Textarea for messages */
.wsgc-chat-instance-wrapper .wsgc-auth-input { /* Auth form inputs */
    padding: 10px;
    margin-bottom: 10px; /* Default margin */
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}
/* Remove margin from message input as it's handled by flex gap */
.wsgc-chat-instance-wrapper .wsgc-active-input-controls .wsgc-message-input {
    margin-bottom: 0;
}


/* General Button Styles (Primary, Secondary, Link-style) */
/* Base button styling (height, padding, etc. applied to more specific selectors below) */
.wsgc-btn, /* A very generic base class if needed */
.wsgc-btn-primary,
.wsgc-btn-secondary,
.wsgc-btn-link-style {
    padding: 10px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
    height: 40px;
    line-height: 1.5; /* For 40px height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none; /* Remove underline from button tags styled as links */
}

.wsgc-btn-primary,
.wsgc-chat-instance-wrapper .wsgc-auth-button { /* .wsgc-auth-button is a primary button */
    background-color: #0073aa; /* Default, overridden by dynamic styles */
    color: white;
}
.wsgc-btn-primary:hover,
.wsgc-chat-instance-wrapper .wsgc-auth-button:hover {
    background-color: #005a87; /* Default, overridden by dynamic styles */
}

.wsgc-btn-secondary {
    background-color: #6c757d; /* Neutral secondary */
    color: white;
    border-color: #6c757d;
}
.wsgc-btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.wsgc-btn-link-style {
    background: none !important;
    border: none !important;
    color: #0073aa !important;
    padding: 0 !important;
    text-decoration: underline !important;
    font-size: 0.9em !important;
    height: auto !important;
    width: auto !important;
    display: inline !important; /* Make it flow like text */
    line-height: normal !important; /* Reset from button base */
}
.wsgc-btn-link-style:hover {
    color: #005a87 !important;
    background: none !important;
}


/* Form specific layouts (e.g., in modals) */
.wsgc-modal .wsgc-form-actions { /* Common class for button groups in modal forms */
    margin-top: 20px;
    display: flex;
    gap: 10px;
}
.wsgc-modal .wsgc-form-actions.wsgc-form-actions-stacked { /* For stacked buttons like in nickname modal */
    flex-direction: column;
}
.wsgc-modal .wsgc-form-actions.wsgc-form-actions-right { /* For right-aligned buttons */
    justify-content: flex-end;
}


/* Form elements within specific modals (auth, nickname, etc.) */
.wsgc-modal .wsgc-modal-content form p,
.wsgc-modal .wsgc-modal-content form fieldset {
    margin-bottom: 15px;
}
.wsgc-modal .wsgc-modal-content form label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal; /* Default label weight */
    font-size: 0.95em;
}
.wsgc-modal .wsgc-modal-content form .wsgc-input-field {
    width: 100%;
    padding: 10px; /* Default padding for modal inputs */
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}

/* Auth Modal Form Specifics */
.wsgc-auth-modal .wsgc-auth-forms-modal-content-area .wsgc-auth-form-container label {
    font-weight: bold; /* Auth labels are bold */
}
.wsgc-auth-modal .wsgc-auth-forms-modal-content-area .wsgc-input-field,
.wsgc-auth-modal .wsgc-auth-forms-modal-content-area .wsgc-auth-input {
    padding: 12px; /* Larger padding for auth inputs */
}
.wsgc-auth-modal .wsgc-auth-forms-modal-content-area .wsgc-auth-button {
    margin-top: 10px;
    width: 100%; /* Auth buttons full width in modal */
    padding: 12px 15px;
}
.wsgc-auth-modal .wsgc-auth-forms-modal-content-area .wsgc-auth-switch-link {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
}
.wsgc-auth-modal .wsgc-auth-forms-modal-content-area .wsgc-auth-switch-link a {
    color: #0073aa; /* Default, overridden by dynamic styles */
    text-decoration: none;
}
.wsgc-auth-modal .wsgc-auth-forms-modal-content-area .wsgc-auth-switch-link a:hover {
    text-decoration: underline;
}


/* Nickname Modals (Set & Change) Form Specifics */
.wsgc-nickname-modal .wsgc-set-nickname-form label,
.wsgc-change-nickname-modal .wsgc-change-nickname-form label {
    font-weight: bold;
}
.wsgc-nickname-modal .wsgc-input-field,
.wsgc-change-nickname-modal .wsgc-input-field {
    padding: 12px;
}
/* Buttons in nickname modal are full width by default */
.wsgc-nickname-modal .wsgc-form-actions {
    flex-direction: column; /* Stack buttons */
}
/* Buttons in change nickname modal are auto width and right aligned */
.wsgc-change-nickname-modal .wsgc-form-actions {
    justify-content: flex-end;
}
.wsgc-change-nickname-modal .wsgc-btn-primary,
.wsgc-change-nickname-modal .wsgc-btn-secondary {
    width: auto;
    padding: 10px 20px; /* Custom padding for these actions */
}
.wsgc-change-nickname-modal .wsgc-start-over-login-btn { /* The link-style button */
    display: block; /* Make it take its own line */
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}


/* Create Channel Modal Form Specifics */
.wsgc-create-channel-form fieldset {
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 3px;
}
.wsgc-create-channel-form fieldset legend {
    font-weight: bold;
    font-size: 0.9em;
    padding: 0 5px;
}
.wsgc-create-channel-form input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}
.wsgc-create-channel-form .wsgc-form-actions {
    justify-content: flex-end;
}
.wsgc-create-channel-form .wsgc-btn-primary,
.wsgc-create-channel-form .wsgc-btn-secondary {
    width: auto;
    padding: 10px 20px;
}

/* Channel Password Modal Form Specifics */
.wsgc-channel-password-form .wsgc-form-actions {
    justify-content: flex-end;
}
.wsgc-channel-password-form .wsgc-btn-primary,
.wsgc-channel-password-form .wsgc-btn-secondary {
    width: auto;
    padding: 10px 20px;
}

/* --- MODIFICATION START: Accessibility & Focus Styles --- */
.wsgc-chat-instance-wrapper button:focus-visible,
.wsgc-chat-instance-wrapper a:focus-visible,
.wsgc-chat-instance-wrapper input:focus-visible,
.wsgc-chat-instance-wrapper textarea:focus-visible,
.wsgc-chat-instance-wrapper [tabindex]:focus-visible,
.wsgc-chat-instance-wrapper select:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 1px;
    box-shadow: 0 0 0 1px #fff; /* Optional: adds contrast against dark backgrounds */
}
/* --- MODIFICATION END --- */