/* Global input field styling for Mental Haven */

/* Restore sensible defaults on form controls that Tailwind preflight makes transparent */
input,
select,
textarea {
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    color: #1f2937 !important; /* text-gray-800 */
}

/* Restore default link styling */
a {
    color: #2563eb; /* blue-600 */
}
a:hover {
    text-decoration: none;
}

/* Common styles for all input fields */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
textarea,
select {
    padding: 0.75rem !important;
    border-width: 1px !important;
    border-color: #d1d5db !important;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease-in-out !important;
    width: 100%;
    color: #374151 !important; /* text-gray-700 for better readability */
    background-color: #ffffff !important; /* ensure inputs are solid, not transparent */
}

/* Placeholder text color - make slightly darker than default */
.form-input::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
input[type="date"]::placeholder,
input[type="time"]::placeholder,
input[type="tel"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
    color: #6b7280 !important; /* text-gray-500 */
}

/* Focus styles */
.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    border-color: #6a0dad !important;
    box-shadow: 0 0 0 3px rgba(106, 13, 173, 0.2) !important;
    outline: none !important;
}

/* Hover styles */
.form-input:hover:not(:focus),
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
input[type="time"]:hover:not(:focus),
input[type="tel"]:hover:not(:focus),
input[type="url"]:hover:not(:focus),
textarea:hover:not(:focus),
select:hover:not(:focus) {
    border-color: #9333ea !important;
}

/* Text area specific styles */
textarea {
    min-height: 100px;
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236a0dad' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem !important;
}

/* Form section styling */
.form-section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

/* Input label styling */
.form-label,
label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
    display: block;
}

/* File input styling */
input[type="file"] {
    padding: 0.5rem !important;
    background-color: #f9fafb;
}

/* Submit button styling */
.btn-primary,
button[type="submit"] {
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease-in-out !important;
    background-color: #6a0dad;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.btn-primary:hover,
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #5a0b8d;
}
