/* =============================================================================
   CALENDAR - Ultra minimal, only colors and position
   DO NOT touch layout/display properties
   ============================================================================= */

/* Popup center position */
.SingleDatePicker_picker {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 999999 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
}

/* Date Input - Dark theme */
body:not(.light-theme) .DateInput_input,
body:not(.light-theme) .DateInput_input__focused {
    color: #f1f5f9 !important;
    background: #1e293b !important;
    border: 1px solid #475569 !important;
}

/* Date Input - Light theme */
body.light-theme .DateInput_input,
body.light-theme .DateInput_input__focused {
    color: #1f2937 !important;
    background: #fff !important;
    border: 1px solid #d1d5db !important;
}

/* Light theme backgrounds */
body.light-theme .SingleDatePicker_picker,
body.light-theme .DayPicker,
body.light-theme .DayPicker__horizontal,
body.light-theme .CalendarMonth,
body.light-theme .CalendarMonthGrid {
    background-color: #fff !important;
}

body.light-theme .CalendarMonth_caption {
    color: #111 !important;
}

body.light-theme .DayPicker_weekHeader small {
    color: #666 !important;
}

body.light-theme .CalendarDay__default {
    color: #333 !important;
    background-color: #fff !important;
}

body.light-theme .CalendarDay__default:hover {
    background-color: #e0e7ff !important;
}

/* Dark theme backgrounds */
body:not(.light-theme) .SingleDatePicker_picker,
body:not(.light-theme) .DayPicker,
body:not(.light-theme) .DayPicker__horizontal,
body:not(.light-theme) .CalendarMonth,
body:not(.light-theme) .CalendarMonthGrid {
    background-color: #1e293b !important;
}

body:not(.light-theme) .CalendarMonth_caption {
    color: #f1f5f9 !important;
}

body:not(.light-theme) .DayPicker_weekHeader small {
    color: #94a3b8 !important;
}

body:not(.light-theme) .CalendarDay__default {
    color: #e2e8f0 !important;
    background-color: #1e293b !important;
}

body:not(.light-theme) .CalendarDay__default:hover {
    background-color: #334155 !important;
}

/* Selected */
.CalendarDay__selected,
.CalendarDay__selected:hover {
    background-color: #3b82f6 !important;
    color: #fff !important;
}

/* Navigation */
.DayPickerNavigation_button {
    background: #3b82f6 !important;
    border: none !important;
}

.DayPickerNavigation_svg {
    fill: #fff !important;
}

/* Hide keyboard shortcuts */
.DayPickerKeyboardShortcuts_show {
    display: none !important;
}

/* =============================================================================
   STOCK SUGGESTIONS DROPDOWN - Grid Add Stock Page
   ============================================================================= */

/* Ensure parent containers don't clip dropdown */
#stock-grid-container {
    overflow: visible !important;
}

#stock-grid-container,
#stock-grid-container .card-body,
#stock-grid-container .addstock-card-body,
#stock-grid-container .addstock-table-wrap,
#stock-grid-container .table-responsive,
#stock-grid-container > div {
    overflow: visible !important;
}

#stock-grid-container table {
    overflow: visible !important;
}

#stock-grid-container tbody {
    overflow: visible !important;
}

#stock-grid-container tr {
    overflow: visible !important;
}

#stock-grid-container td {
    overflow: visible !important;
    position: relative;
}

.grid-suggestions {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 999999 !important;
    width: 280px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    background: linear-gradient(180deg, rgba(20,30,40,0.98), rgba(15,25,35,0.98)) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
    margin-top: 4px !important;
}

body.light-theme .grid-suggestions {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
}

.grid-suggestions .suggestion-item {
    padding: 10px 14px !important;
    cursor: pointer !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    transition: background 0.15s ease !important;
}

.grid-suggestions .suggestion-item:hover {
    background: rgba(59, 130, 246, 0.2) !important;
}

body.light-theme .grid-suggestions .suggestion-item {
    border-bottom: 1px solid #e5e7eb !important;
}

body.light-theme .grid-suggestions .suggestion-item:hover {
    background: #eff6ff !important;
}

body.light-theme .grid-suggestions .suggestion-symbol {
    color: #1f2937 !important;
}

body.light-theme .grid-suggestions .suggestion-name {
    color: #6b7280 !important;
}

body.light-theme .grid-suggestions .suggestion-price {
    color: #3b82f6 !important;
}

/* Ensure table doesn't clip dropdown */
#stock-grid-container,
#stock-grid-container table,
#stock-grid-container tbody,
#stock-grid-container tr,
#stock-grid-container td {
    overflow: visible !important;
}
