/* ============================================
   ADMIN STARTER KITS - SHARED COMPONENTS
   Özel form elementleri ve UI bileşenleri
   ============================================ */

/* ============================================
   CUSTOM SELECT BOX
   ============================================ */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.custom-select-trigger:hover {
    border-color: rgb(var(--color-primary-500));
    background: rgba(30, 41, 59, 0.7);
}

.custom-select-trigger:focus {
    outline: none;
    border-color: rgb(var(--color-primary-500));
    box-shadow: 0 0 0 3px rgba(var(--color-primary-500), 0.2);
}

.custom-select-trigger .placeholder {
    color: #64748b;
}

.custom-select-trigger .arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.custom-select.open .arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.custom-select.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-search {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.custom-select-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
}

.custom-select-search input:focus {
    outline: none;
    border-color: rgb(var(--color-primary-500));
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-select-option:hover {
    background: rgba(var(--color-primary-500), 0.1);
}

.custom-select-option.selected {
    background: rgba(var(--color-primary-500), 0.2);
    color: rgb(var(--color-primary-400));
}

.custom-select-option .check-icon {
    width: 18px;
    height: 18px;
    margin-left: auto;
    opacity: 0;
}

.custom-select-option.selected .check-icon {
    opacity: 1;
    color: rgb(var(--color-primary-400));
}

.custom-select-option img,
.custom-select-option .option-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}

.custom-select-group-label {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    background: rgba(15, 23, 42, 0.3);
}

/* Multi-select tags */
.custom-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.custom-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: rgba(var(--color-primary-500), 0.2);
    color: rgb(var(--color-primary-400));
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.custom-select-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    transition: background 0.15s;
}

.custom-select-tag button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   CUSTOM CHECKBOX
   ============================================ */
.custom-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-checkbox .checkbox-box {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(71, 85, 105, 0.6);
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.custom-checkbox .checkbox-box svg {
    width: 12px;
    height: 12px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-checkbox:hover .checkbox-box {
    border-color: rgb(var(--color-primary-500));
    background: rgba(var(--color-primary-500), 0.1);
}

.custom-checkbox input:checked + .checkbox-box {
    background: rgb(var(--color-primary-500));
    border-color: rgb(var(--color-primary-500));
}

.custom-checkbox input:checked + .checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.custom-checkbox input:focus + .checkbox-box {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-500), 0.2);
}

/* Indeterminate state */
.custom-checkbox input:indeterminate + .checkbox-box {
    background: rgb(var(--color-primary-500));
    border-color: rgb(var(--color-primary-500));
}

.custom-checkbox input:indeterminate + .checkbox-box::before {
    content: '';
    width: 10px;
    height: 2px;
    background: white;
    border-radius: 1px;
}

/* Checkbox sizes */
.custom-checkbox.sm .checkbox-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.custom-checkbox.sm .checkbox-box svg {
    width: 10px;
    height: 10px;
}

.custom-checkbox.lg .checkbox-box {
    width: 24px;
    height: 24px;
    border-radius: 8px;
}

.custom-checkbox.lg .checkbox-box svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   CUSTOM RADIO
   ============================================ */
.custom-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

.custom-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-radio .radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(71, 85, 105, 0.6);
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.custom-radio .radio-circle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-radio:hover .radio-circle {
    border-color: rgb(var(--color-primary-500));
}

.custom-radio input:checked + .radio-circle {
    background: rgb(var(--color-primary-500));
    border-color: rgb(var(--color-primary-500));
}

.custom-radio input:checked + .radio-circle::after {
    opacity: 1;
    transform: scale(1);
}

.custom-radio input:focus + .radio-circle {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-500), 0.2);
}

/* ============================================
   CUSTOM TOGGLE SWITCH
   ============================================ */
.custom-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

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

.custom-toggle .toggle-track {
    width: 44px;
    height: 24px;
    background: rgba(71, 85, 105, 0.5);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.custom-toggle .toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-toggle:hover .toggle-track {
    background: rgba(71, 85, 105, 0.7);
}

.custom-toggle input:checked + .toggle-track {
    background: rgb(var(--color-primary-500));
}

.custom-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(20px);
}

.custom-toggle input:focus + .toggle-track {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-500), 0.2);
}

/* Toggle with icons */
.custom-toggle .toggle-track.with-icons::before,
.custom-toggle .toggle-track.with-icons::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 600;
}

.custom-toggle .toggle-track.with-icons::before {
    content: '✓';
    left: 7px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-toggle .toggle-track.with-icons::after {
    content: '✕';
    right: 7px;
    color: rgba(255, 255, 255, 0.5);
    transition: opacity 0.2s;
}

.custom-toggle input:checked + .toggle-track.with-icons::before {
    opacity: 1;
}

.custom-toggle input:checked + .toggle-track.with-icons::after {
    opacity: 0;
}

/* Toggle sizes */
.custom-toggle.sm .toggle-track {
    width: 36px;
    height: 20px;
}

.custom-toggle.sm .toggle-thumb {
    width: 16px;
    height: 16px;
}

.custom-toggle.sm input:checked + .toggle-track .toggle-thumb {
    transform: translateX(16px);
}

.custom-toggle.lg .toggle-track {
    width: 56px;
    height: 30px;
    border-radius: 15px;
}

.custom-toggle.lg .toggle-thumb {
    width: 26px;
    height: 26px;
}

.custom-toggle.lg input:checked + .toggle-track .toggle-thumb {
    transform: translateX(26px);
}

/* ============================================
   CUSTOM DATE PICKER
   ============================================ */
.custom-datepicker {
    position: relative;
    width: 100%;
}

.custom-datepicker-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    width: 100%;
}

.custom-datepicker-trigger:hover {
    border-color: rgb(var(--color-primary-500));
}

.custom-datepicker-trigger .icon {
    color: #64748b;
}

.custom-datepicker-trigger .placeholder {
    color: #64748b;
}

.custom-datepicker-calendar {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    min-width: 300px;
}

.custom-datepicker.open .custom-datepicker-calendar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.custom-datepicker-header button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(71, 85, 105, 0.3);
    color: #94a3b8;
    transition: all 0.15s;
}

.custom-datepicker-header button:hover {
    background: rgba(var(--color-primary-500), 0.2);
    color: rgb(var(--color-primary-400));
}

.custom-datepicker-header .month-year {
    font-weight: 600;
    color: #e2e8f0;
}

.custom-datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
}

.custom-datepicker-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    padding: 0.5rem 0;
}

.custom-datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.custom-datepicker-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: #cbd5e1;
}

.custom-datepicker-day:hover {
    background: rgba(var(--color-primary-500), 0.2);
    color: white;
}

.custom-datepicker-day.other-month {
    color: #475569;
}

.custom-datepicker-day.today {
    background: rgba(var(--color-primary-500), 0.1);
    color: rgb(var(--color-primary-400));
    font-weight: 600;
}

.custom-datepicker-day.selected {
    background: rgb(var(--color-primary-500));
    color: white;
    font-weight: 600;
}

.custom-datepicker-day.in-range {
    background: rgba(var(--color-primary-500), 0.2);
}

.custom-datepicker-day.disabled {
    color: #334155;
    cursor: not-allowed;
}

/* Time picker */
.custom-datepicker-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.custom-datepicker-time input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
}

.custom-datepicker-time input:focus {
    outline: none;
    border-color: rgb(var(--color-primary-500));
}

.custom-datepicker-time span {
    color: #64748b;
    font-weight: 600;
}

/* Quick actions */
.custom-datepicker-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.custom-datepicker-quick button {
    padding: 0.375rem 0.75rem;
    background: rgba(71, 85, 105, 0.3);
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.8125rem;
    transition: all 0.15s;
}

.custom-datepicker-quick button:hover {
    background: rgba(var(--color-primary-500), 0.2);
    color: rgb(var(--color-primary-400));
}

/* ============================================
   CUSTOM TIME PICKER
   ============================================ */
.custom-timepicker {
    position: relative;
    width: 100%;
}

.custom-timepicker-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-timepicker-trigger:hover {
    border-color: rgb(var(--color-primary-500));
}

.custom-timepicker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.custom-timepicker.open .custom-timepicker-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-timepicker-column {
    display: flex;
    flex-direction: column;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.custom-timepicker-column::-webkit-scrollbar {
    width: 4px;
}

.custom-timepicker-column::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.5);
    border-radius: 2px;
}

.custom-timepicker-option {
    padding: 0.5rem 1rem;
    text-align: center;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #94a3b8;
    min-width: 50px;
}

.custom-timepicker-option:hover {
    background: rgba(var(--color-primary-500), 0.2);
    color: white;
}

.custom-timepicker-option.selected {
    background: rgb(var(--color-primary-500));
    color: white;
}

/* ============================================
   CUSTOM INPUT
   ============================================ */
.custom-input {
    position: relative;
    width: 100%;
}

.custom-input input,
.custom-input textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    color: #e2e8f0;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.custom-input input:hover,
.custom-input textarea:hover {
    border-color: rgba(71, 85, 105, 0.8);
}

.custom-input input:focus,
.custom-input textarea:focus {
    outline: none;
    border-color: rgb(var(--color-primary-500));
    box-shadow: 0 0 0 3px rgba(var(--color-primary-500), 0.15);
}

.custom-input input::placeholder,
.custom-input textarea::placeholder {
    color: #64748b;
}

/* Input with icon */
.custom-input.has-icon-left input {
    padding-left: 2.75rem;
}

.custom-input.has-icon-right input {
    padding-right: 2.75rem;
}

.custom-input .input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.custom-input .input-icon.left {
    left: 1rem;
}

.custom-input .input-icon.right {
    right: 1rem;
}

/* Input with addon */
.custom-input-group {
    display: flex;
}

.custom-input-group .addon {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: #94a3b8;
    font-size: 0.875rem;
}

.custom-input-group .addon:first-child {
    border-right: none;
    border-radius: 0.75rem 0 0 0.75rem;
}

.custom-input-group .addon:last-child {
    border-left: none;
    border-radius: 0 0.75rem 0.75rem 0;
}

.custom-input-group input {
    border-radius: 0;
}

.custom-input-group input:first-child {
    border-radius: 0.75rem 0 0 0.75rem;
}

.custom-input-group input:last-child {
    border-radius: 0 0.75rem 0.75rem 0;
}

/* Input states */
.custom-input.error input {
    border-color: #ef4444;
}

.custom-input.error input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.custom-input.success input {
    border-color: #10b981;
}

.custom-input.success input:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.custom-input .error-message {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #ef4444;
}

.custom-input .helper-text {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #64748b;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.5);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.8);
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
.light .custom-select-trigger,
.light .custom-datepicker-trigger,
.light .custom-timepicker-trigger,
.light .custom-input input,
.light .custom-input textarea {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(203, 213, 225, 0.8);
    color: #1e293b;
}

.light .custom-select-dropdown,
.light .custom-datepicker-calendar,
.light .custom-timepicker-dropdown {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.8);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.light .custom-select-option:hover,
.light .custom-datepicker-day:hover,
.light .custom-timepicker-option:hover {
    background: rgba(var(--color-primary-500), 0.1);
}

.light .custom-checkbox .checkbox-box,
.light .custom-radio .radio-circle,
.light .custom-toggle .toggle-track {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(203, 213, 225, 0.8);
}

.light .custom-datepicker-day {
    color: #334155;
}

.light .custom-datepicker-day.other-month {
    color: #94a3b8;
}
