/* CSS Styles for IOSUI Components from uinterface1.html */
/* Extracted CSS for classes used by uinterface.module.js */

:root {
    color-scheme: dark;
    --bg-gradient: radial-gradient(circle at 22% 16%, rgba(170, 192, 214, 0.4), transparent 60%),
                     radial-gradient(circle at 76% 18%, rgba(99, 140, 181, 0.45), transparent 58%),
                     radial-gradient(circle at 30% 86%, rgba(42, 67, 102, 0.38), transparent 52%),
                     linear-gradient(180deg, #030812 0%, #0a1b2e 32%, #143349 65%, #0d253d 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.24);
    --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    /* Common tokens used by components and utilities */
    --radius: 14px; /* default panel radius */
    --shadow: var(--glass-shadow); /* alias for legacy usages */
    --transition: all 200ms ease; /* default transition timing */
    --accent: #4f8cff;
    --accent-glow: rgba(79, 140, 255, 0.55);
    --text-primary: #f2f5ff;
    --text-secondary: rgba(242, 245, 255, 0.68);
    --slider-track: rgba(255, 255, 255, 0.18);
}

/* ios-label - Used by createLabel() */
.ios-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ios-label--primary {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.08em;
}

/* ios-button - Used by createButton() */
.ios-button {
    appearance: none;
    border: none;
    border-radius: 14px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #0f172a;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 160ms ease;
}

.ios-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.28);
}

.ios-button:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.3);
}

.ios-button--ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* ios-field - Used by createTextField(), createTextView(), createDatePicker(), createPickerView() */
.ios-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ios-input - Used by createTextField() */
.ios-input,
.ios-textarea,
.ios-select,
.ios-date {
    width: 100%;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(10, 18, 38, 0.35);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.25);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.ios-input:focus,
.ios-textarea:focus,
.ios-select:focus,
.ios-date:focus {
    outline: none;
    border-color: rgba(79, 140, 255, 0.55);
    box-shadow: inset 0 12px 24px rgba(0, 0, 0, 0.28), 0 0 0 4px rgba(79, 140, 255, 0.18);
}

/* ios-textarea - Used by createTextView() */
.ios-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ios-toggle - Used by createSwitch() */
.ios-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.ios-toggle input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: inherit;
    z-index: 2;
}

.ios-toggle__track {
    width: 54px;
    height: 32px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    padding: 3px;
    transition: background 140ms ease, border-color 140ms ease;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.25);
    position: relative;
}

.ios-toggle__thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
    transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ios-toggle input:checked + .ios-toggle__track {
    background: var(--accent);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 20px rgba(79, 140, 255, 0.35);
}

.ios-toggle input:checked + .ios-toggle__track .ios-toggle__thumb {
    transform: translateX(22px);
    box-shadow: 0 10px 20px rgba(79, 140, 255, 0.35);
}

.ios-toggle__label {
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

/* ios-slider - Used by createSlider() */
.ios-slider {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ios-slider__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ios-slider__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.ios-slider__value {
    font-size: 1.4rem;
    font-weight: 600;
}

.ios-slider__range {
    appearance: none;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: var(--slider-track);
    outline: none;
    position: relative;
}

.ios-slider__range::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 22px rgba(79, 140, 255, 0.35), 0 0 0 8px rgba(79, 140, 255, 0.15);
    transition: transform 120ms ease, box-shadow 160ms ease;
}

.ios-slider__range::-webkit-slider-thumb:active {
    transform: scale(1.06);
    box-shadow: 0 14px 26px rgba(79, 140, 255, 0.38), 0 0 0 12px rgba(79, 140, 255, 0.18);
}

.ios-slider__ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ios-segmented - Used by createSegmentedControl() */
.ios-segmented {
    position: relative;
    display: flex;
    padding: 4px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    overflow: hidden;
    width: 100%;
    gap: 8px;
}

.ios-segmented--content {
    width: auto;
    max-width: 100%;
    display: inline-flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 auto;
}

.ios-segmented__thumb {
    position: absolute;
    border-radius: 12px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.25);
    transition: left 180ms cubic-bezier(0.22, 1, 0.36, 1), top 180ms cubic-bezier(0.22, 1, 0.36, 1), width 180ms ease, height 180ms ease;
    will-change: left, top, width, height;
    pointer-events: none;
    left: 0;
    top: 0;
}

.ios-segmented__option {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 120ms ease;
    flex: 1 1 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.ios-segmented--content .ios-segmented__option {
    flex: 0 1 auto;
    min-width: 72px;
    padding: 8px 18px;
}

.ios-segmented__option--active {
    color: #0f172a;
}

.ios-segmented--vertical {
    flex-direction: column;
}

/* ios-control-group - Used by createActivityIndicator() */
.ios-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ios-activity - Used by createActivityIndicator() */
.ios-activity {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 255, 255, 0.82);
    animation: ios-spin 0.9s linear infinite;
}

@keyframes ios-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ios-progress - Used by createProgressView() */
.ios-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.35);
}

.ios-progress__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(79, 140, 255, 0.85), rgba(117, 194, 255, 0.9));
    transition: width 160ms ease;
}

/* ios-date - Used by createDatePicker() */
/* Styles already included in .ios-input, .ios-textarea, .ios-select, .ios-date section above */

/* ios-stepper - Used by createStepper() */
.ios-stepper {
    display: inline-flex;
    align-items: center;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
}

.ios-stepper__btn {
    width: 40px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 120ms ease;
    border: none;
    background: transparent;
}

.ios-stepper__btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.ios-stepper__value {
    min-width: 56px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

/* ios-select - Used by createPickerView() */
/* Styles already included in .ios-input, .ios-textarea, .ios-select, .ios-date section above */

/* ios-image-wrapper - Used by createImageView() */

/* iOS-style glass panel utility (use on dropdowns, popovers, menus) */
.ios-glass-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.ios-image-wrapper {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
    aspect-ratio: 16 / 9;
    width: 100%;
}

.ios-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* stack - Used by createStepper() utility class */
.stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}