/* .admin-form-group → .form-group */
.form-group {
    margin-bottom: 1.5rem;
    flex: 1;
}

/* .admin-form-label → .form-label */
.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

/* .form-control → .form-control */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--accent-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(94, 53, 177, 0.25);
}

/* .admin-form-text → .form-help-text */
.form-help-text {
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

/* Input with icon styling - updated to move icon inside */
.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    z-index: 1;
    pointer-events: none; /* Ensure icon doesn't interfere with input clicks */
}

.input-with-icon .form-control {
    padding-left: 40px; /* Make room for the icon */
}

/* For textarea with icon */
.textarea-with-icon {
    padding-left: 40px; /* Match input padding */
}

.textarea-container {
    position: relative;
}

.textarea-container i {
    position: absolute;
    left: 12px;
    top: 16px; /* Adjust for textarea which has different height */
    color: var(--text-tertiary);
    z-index: 1;
    pointer-events: none;
}

/* Focus state styling */
.input-with-icon .form-control:focus + i,
.input-with-icon .form-control:focus ~ i {
    color: var(--accent-primary); /* Change icon color on input focus */
}

/* Date picker specific adjustment if needed */
.date-picker-container i {
    color: var(--accent-primary);
}

/* Search input specific styling */
.skills-filter .input-with-icon i {
    color: var(--accent-primary);
}

/* Toggle Switch Styles */
.status-toggle-wrapper {
    display: flex;
    gap: 12px;
}

.status-toggle {
    position: relative;
    display: inline-block;
}

.status-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.status-toggle-label {
    display: block;
    width: 48px;
    height: 24px;
    border-radius: 12px;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    position: relative;
    transition: background-color var(--transition-normal);
    margin: 0;
}

.status-toggle-label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.status-toggle-input:checked + .status-toggle-label {
    background-color: var(--accent-primary);
}

.status-toggle-input:checked + .status-toggle-label::after {
    transform: translateX(24px);
}

.status-label {
    font-weight: 500;
    font-size: var(--font-size-sm);
    flex: 1;
    margin: auto;
}

.status-label .status-active,
.status-label .status-inactive {
    display: none;
}

.status-label.is-active .status-active {
    display: inline;
}

.status-label.is-inactive .status-inactive {
    display: inline;
    color: var(--text-tertiary);
}

/* Animation for smooth transition */
.status-toggle-label:active::after {
    width: 28px;
}

.status-toggle-input:checked + .status-toggle-label:active::after {
    transform: translateX(16px);
}

/* Add spacing between text and dropdown arrow in select elements */
.form-control {
    /* Increase right padding to create more space for the dropdown arrow */
    padding-right: 2.5rem;
    /* Ensure the text doesn't overflow into the arrow area */
    text-overflow: ellipsis;
}



/* Style the select element to ensure proper arrow positioning */
select.form-control {
    /* Use this approach for more control over the arrow appearance */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    /* Remove default arrow in some browsers */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Additional styles to ensure it works across browsers */
select.form-control::-ms-expand {
    display: none;
}

/* Optional: Add some styling for focus state */
select.form-control:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235E35B1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
}

/* Options selector */

/* Item Selector Component */
.item-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.item-selector-card {
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    aspect-ratio: 1 / 1; /* Forces a 1:1 aspect ratio (square) */
    min-height: 150px; /* Set a minimum height */
}

.item-selector-card:hover {
    background-color: var(--bg-secondary);
    transform: translateY(-2px);
}

.item-selector-card.selected {
    border-color: var(--accent-primary);
    background-color: rgba(var(--accent-primary-rgb, 0, 123, 255), 0.05);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb, 0, 123, 255), 0.3);
}

.item-selector-icon {
    font-size: 24px;
    color: var(--text-secondary);
    height: 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border-radius: 50%;
}

.item-selector-icon adaptive-icon {
    color: var(--text-secondary);
    height: 30px;
    width: 30px;
    display: flex;
}

.item-selector-card.selected .item-selector-icon {
    color: var(--accent-primary);
    background-color: rgba(var(--accent-primary-rgb, 0, 123, 255), 0.1);
}

.item-selector-title {
    font-weight: 500;
    font-size: 14px;
    margin: 0;
}

.item-selector-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.item-selector-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

input[type="radio"].item-selector-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.item-selector-empty {
    grid-column: 1 / -1;
    padding: 20px;
    text-align: center;
    border: 1px dashed var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
}

.item-selector-empty a {
    color: var(--accent-primary);
    text-decoration: none;
}

.item-selector-empty a:hover {
    text-decoration: underline;
}

.item-selector-add {
    border: 1px dashed var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.item-selector-add:hover {
    border-color: var(--accent-primary);
    background-color: rgba(var(--accent-primary-rgb, 0, 123, 255), 0.05);
}

.item-selector-add-icon {
    font-size: 24px;
    color: var(--text-tertiary);
    height: 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border-radius: 50%;
}

.item-selector-add:hover .item-selector-add-icon {
    color: var(--accent-primary);
    background-color: rgba(var(--accent-primary-rgb, 0, 123, 255), 0.1);
}

.item-selector-add-text {
    font-weight: 500;
    font-size: 14px;
    margin: 0;
    color: var(--text-secondary);
}

.item-selector-add:hover .item-selector-add-text {
    color: var(--accent-primary);
}

/* Filter component for search */
.item-selector-filter {
    margin-bottom: 15px;
}

/* Custom scrollbar for selector with many items */
.item-selector-grid.scrollable {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.item-selector-grid.scrollable::-webkit-scrollbar {
    width: 6px;
}

.item-selector-grid.scrollable::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.item-selector-grid.scrollable::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.item-selector-grid.scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}


.calendar-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-btn:hover {
    color: var(--accent-primary);
}

/* Make sure there's no extra space */
.input-with-icon input {
    padding-right: 40px;
}

/* Override default icon positioning for date inputs */
.input-with-icon input[type="date"] {
    padding-left: 1rem; /* Reset the left padding to normal */
    padding-right: 40px; /* Make room for the calendar button on the right */
}

/* Hide the default calendar icon in some browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}

/* Ensure the calendar button is properly positioned */
.input-with-icon .calendar-btn {
    right: 10px;
    z-index: 2; /* Higher z-index to appear above other elements */
}