/* ============================================================================
   components/inputs.css — Form Input Component Styles

   Base input styles are in base.css (native input, textarea, select).
   These are the semantic classes for styled form components.
   ============================================================================ */

/* Input base class — transparent, styled by parent wrapper */
.input {
    width: 100%;
    padding: var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-text-main);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    outline: none;
}

.input::placeholder {
    color: var(--color-text-subtle);
}

.input:focus {
    outline: 2px solid var(--entity-focus-color, currentColor);
    outline-offset: 2px;
    box-shadow: none;
}

.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Textarea */
.textarea {
    min-height: 100px;
    resize: vertical;
}

/* Select with custom arrow — transparent, styled by parent wrapper */
.select {
    width: auto;
    min-width: 140px;
    padding: var(--space-2) var(--space-10) var(--space-2) var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-text-main);
    background-color: transparent;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23737373' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548L10 12.032l4.484-4.484L16 8.064l-6 6-6-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    appearance: none;
    outline: none;
}

.select:focus {
    outline: 2px solid var(--entity-focus-color, currentColor);
    outline-offset: 2px;
    box-shadow: none;
}

/* Form Select — transparent, styled by parent wrapper */
.form-select {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  color: var(--color-text-main);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  appearance: none;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  padding-right: var(--space-8);
  min-width: 140px;
}

.form-select:focus,
.form-select:focus-visible {
  outline: 2px solid var(--entity-focus-color, currentColor);
  outline-offset: 2px;
  box-shadow: none;
}

.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form groups */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
}

.form-hint {
    margin-top: var(--space-1);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.form-error {
    margin-top: var(--space-1);
    font-size: var(--text-sm);
    color: var(--color-danger);
}

/* ============================================================================
   AddressInput — Google Places Autocomplete Component
   ============================================================================ */

.address-input {
    position: relative;
    width: 100%;
}

.address-input__field {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: background 0.15s ease, border-color 0.15s ease, backdrop-filter 0.15s ease;
}

.address-input__field:hover,
.address-input__field:focus-within {
    background: var(--theme-chrome-bg);
    -webkit-backdrop-filter: var(--theme-chrome-blur);
    backdrop-filter: var(--theme-chrome-blur);
    border-color: rgba(255, 255, 255, 0.20);
}

/* Remove global focus-visible outline since we use border color change */
.address-input__input:focus,
.address-input__input:focus-visible {
    outline: none;
}

.address-input__icon {
    flex-shrink: 0;
    font-size: var(--icon-md);
    color: var(--color-text-muted);
}

.address-input__input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-text-main);
    outline: none;
}

.address-input__input::placeholder {
    color: var(--color-text-subtle);
}

.address-input__input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.address-input__clear {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.address-input__clear:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-main);
}

.address-input__clear .material-symbols-rounded {
    font-size: var(--icon-md);
}

.address-input__spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.address-input__spinner .material-symbols-rounded {
    font-size: var(--icon-md);
}

.address-input__spinner .rotating {
    animation: spin 1s linear infinite;
}

/* Dropdown */
.address-input__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    margin-top: var(--space-1);
    background: var(--theme-window-bg);
    -webkit-backdrop-filter: var(--theme-window-blur);
    backdrop-filter: var(--theme-window-blur);
    border: var(--theme-window-border);
    border-radius: var(--radius-md);
    box-shadow: var(--theme-window-shadow);
    max-height: 280px;
    overflow-y: auto;
}

.address-input__predictions {
    padding: var(--space-1);
}

.address-input__prediction {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-2);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.address-input__prediction:hover,
.address-input__prediction.is-selected {
    background: var(--color-bg-hover);
}

.address-input__prediction-icon {
    flex-shrink: 0;
    font-size: var(--icon-md);
    color: var(--color-text-muted);
    margin-top: 2px;
}

.address-input__prediction-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.address-input__prediction-main {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-input__prediction-secondary {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-input__empty {
    padding: var(--space-3);
    text-align: center;
    font-size: var(--text-base);
    color: var(--color-text-muted);
}

.address-input__error {
    color: var(--color-danger);
}

/* Portal mode (dropdown mounted on document.body) */
.address-input__dropdown--portal {
    position: fixed;
    z-index: var(--z-modal, 500);
}

/* Custom Select (existing) */
.custom-select {
    position: relative;
    display: inline-block;
}

.custom-select__trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text-main);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, backdrop-filter 0.15s ease;
}

.custom-select__trigger:hover,
.custom-select__trigger.is-open {
    background: var(--theme-chrome-bg);
    -webkit-backdrop-filter: var(--theme-chrome-blur);
    backdrop-filter: var(--theme-chrome-blur);
    border-color: rgba(255, 255, 255, 0.20);
}

.custom-select__label {
    flex: 1;
    text-align: left;
}

.custom-select__arrow {
    flex-shrink: 0;
    font-size: var(--icon-md);
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.custom-select__trigger.is-open .custom-select__arrow {
    transform: rotate(180deg);
}

.custom-select__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    margin-top: var(--space-1);
    background: var(--theme-window-bg);
    -webkit-backdrop-filter: var(--theme-window-blur);
    backdrop-filter: var(--theme-window-blur);
    border: var(--theme-window-border);
    border-radius: var(--radius-md);
    box-shadow: var(--theme-window-shadow);
    max-height: 280px;
    overflow-y: auto;
}

.custom-select__options {
    padding: var(--space-1);
}

.custom-select__option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text-main);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.custom-select__option:hover,
.custom-select__option.is-selected {
    background: var(--color-bg-hover);
}

.custom-select__option.is-selected {
    font-weight: var(--font-medium);
}

.custom-select__count {
    margin-left: auto;
    font-size: var(--text-base);
    color: var(--color-text-muted);
}

.custom-select__empty {
    padding: var(--space-3);
    text-align: center;
    font-size: var(--text-base);
    color: var(--color-text-muted);
}

/* ============================================================================
   StaticMap — Google Maps Static Image Display
   ============================================================================ */

.static-map {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    background: var(--theme-inner-inset-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.static-map--empty,
.static-map--error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
}

.static-map--empty .material-symbols-rounded,
.static-map--error .material-symbols-rounded {
    font-size: var(--icon-2xl);
    opacity: 0.5;
}

.static-map__empty-text,
.static-map__error-text {
    font-size: var(--text-base);
}

.static-map__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
}

.static-map__loading .material-symbols-rounded {
    font-size: var(--icon-2xl);
}

.static-map__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.static-map__overlay {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: var(--color-bg-panel);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    color: var(--color-text-main);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.static-map__overlay:hover {
    transform: scale(1.1);
}

.static-map:hover .static-map__overlay {
    opacity: 1;
}

.static-map__overlay .material-symbols-rounded {
    font-size: var(--icon-md);
}

/* Toggle styles are in toggle.css */
