/*
 * ios-design.css — supplemental iOS component styles.
 * Core design tokens and variables are defined in app.css (:root).
 * This file assumes app.css is loaded first.
 */

/*
==============================================
 Fix for Button Styles
==============================================
*/

.ios-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: var(--aey-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background-color: var(--system-blue);
    color: white;
    transition: background-color 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent; /* Disable tap highlight on iOS */
}

.ios-btn:active {
    transform: scale(0.97);
}

.ios-btn:disabled {
    background-color: var(--system-gray-4);
    cursor: not-allowed;
    transform: none;
}

.ios-btn-secondary {
    background-color: var(--system-gray-5);
    color: var(--system-blue);
}

.ios-btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 10px;
    font-weight: 500;
}

/*
==============================================
 ios-input: unified text/select field style
==============================================
*/
.ios-input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--aey-radius);
    background: var(--ios-fill);
    color: var(--ios-text);
    appearance: none;
    -webkit-appearance: none;
    transition: box-shadow 0.15s ease, background 0.15s ease;
    font-family: var(--font-body);
}

.ios-input:focus {
    outline: none;
    background: var(--ios-card);
    box-shadow: 0 0 0 3px var(--accent-soft-12);
}

.ios-input::placeholder {
    color: var(--ios-muted);
}

/* ── Safe area helpers ── */
.safe-area-top    { padding-top:    env(safe-area-inset-top); }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ── iOS empty state ── */
.ios-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ios-muted);
    font-size: 0.9rem;
}

/* ── ae-modal inner components (used in Templates, CategoryManager etc.) ── */
.ae-modal-section {
    margin-bottom: 1rem;
}

.ae-modal-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ios-muted);
    letter-spacing: 0.2px;
}

.ae-modal-input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem;
    border: var(--hairline-width) solid var(--ios-separator);
    border-radius: var(--ios-radius-sm);
    background: var(--ios-card);
    color: var(--ios-text);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease;
    font-family: var(--font-body);
}

.ae-modal-input:focus {
    outline: none;
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 3px var(--accent-soft-12);
}

.ae-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--ios-muted);
    transition: background 0.15s;
}

.ae-icon-btn:hover { background: var(--ios-fill); }

.ae-confirm-error {
    color: var(--ui-danger);
    font-size: 0.82rem;
    padding: 0.4rem 0.75rem;
    background: var(--danger-soft-10);
    border-radius: var(--ios-radius-xs);
}

/*
==============================================
 Stage 8 Refactoring: Aesthetics & Micro-interactions
==============================================
*/


/*
==============================================
 Fix for Batch Update Sheet Layout
==============================================
*/

.ios-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-backdrop-bg);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ios-sheet-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.ios-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 80vh;
    background-color: var(--secondary-system-background);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.ios-sheet-overlay.show .ios-sheet {
    transform: translateY(0);
}

.ios-sheet-indicator {
    width: 40px;
    height: 5px;
    background-color: var(--system-gray-4);
    border-radius: 2.5px;
    margin: 0 auto 12px;
}

.ios-sheet-header {
    flex-shrink: 0;
}

.ios-sheet-content {
    overflow-y: auto;
}
