/**
 * Schedule Dialog UX Improvements
 *
 * Design principles applied:
 * - Fitts' Law: Touch targets min 2.75rem (~44px on 360px viewport)
 * - Gestalt Proximity: Related fields visually grouped
 * - Visual Hierarchy: Primary vs secondary actions clearly distinguished
 * - Consistency: Matches patterns from Mood, AI Preferences dialogs
 *
 * Base calculation: 1rem ≈ 10.8px on 360x800 viewport
 * clamp(7px, min(3vw, 2.4vh), 1.25rem)
 */

/* ============================================
   FORM SECTION GROUPING
   ============================================ */
.dialog .form-section {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.dialog .form-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.75rem;
    display: block;
}

/* ============================================
   IMPROVED RANGE ROW LAYOUT
   ============================================ */
.dialog .range-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.dialog .range-row .labeled-input {
    flex: 1;
    min-width: 0;
}

.dialog .range-row .range-separator {
    color: #999;
    font-size: 1.2rem;
    flex-shrink: 0;
    padding: 0 0.25rem;
}

/* ============================================
   INPUT FIELD STANDARDIZATION
   ============================================ */
.dialog input[type="date"],
.dialog input[type="time"],
.dialog input[type="text"],
.dialog input[type="email"],
.dialog select {
    width: 100%;
    min-height: 2.75rem; /* Fitts' Law: ~44px on 360px viewport */
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dialog input[type="date"]:focus,
.dialog input[type="time"]:focus,
.dialog input[type="text"]:focus,
.dialog input[type="email"]:focus,
.dialog select:focus {
    border-color: #d4a017;
    outline: none;
    box-shadow: 0 0 0 0.125rem rgba(212, 160, 23, 0.25);
}

/* Label above input pattern */
.dialog label > .text {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.35rem;
}

/* ============================================
   ACTION LIST ENHANCEMENTS
   (Works with existing rounded pill button style)
   ============================================ */

/* Ensure action-list buttons have proper touch targets */
.dialog .action-list .action-item {
    min-height: 2.75rem; /* Fitts' Law: ~44px on 360px viewport */
    min-width: 5rem;
    padding: 0.5rem 1rem;
}

/* Subtle hover enhancement */
.dialog .action-list .action-item:hover {
    transform: scale(1.02);
    transition: transform 0.15s ease-in-out;
}

/* ============================================
   SCHEDULE DIALOG SPECIFIC
   ============================================ */

/* Experience/Place input with icon hint */
.dialog label.place {
    width: 100%;
    margin-bottom: 1rem;
}

.dialog label.place input {
    padding-left: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    background-size: 1rem;
}

/* Date/Time range section styling */
.dialog .date-range,
.dialog .time-range {
    margin-bottom: 1rem;
}

.dialog .date-range > .text,
.dialog .time-range > .text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icon prefix for labels */
.dialog .date-range > .text::before {
    content: "📅";
    font-size: 1rem;
}

.dialog .time-range > .text::before {
    content: "🕐";
    font-size: 1rem;
}

/* Stack layout for schedule form */
.dialog .schedule-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   CONSISTENT SPACING SCALE (8px grid in rem)
   ============================================ */
.dialog .gap-xs { gap: 0.25rem; }  /* 4px */
.dialog .gap-sm { gap: 0.5rem; }   /* 8px */
.dialog .gap-md { gap: 0.75rem; }  /* 12px */
.dialog .gap-lg { gap: 1rem; }     /* 16px */
.dialog .gap-xl { gap: 1.5rem; }   /* 24px */

.dialog .mb-xs { margin-bottom: 0.25rem; }
.dialog .mb-sm { margin-bottom: 0.5rem; }
.dialog .mb-md { margin-bottom: 0.75rem; }
.dialog .mb-lg { margin-bottom: 1rem; }
.dialog .mb-xl { margin-bottom: 1.5rem; }

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 480px) {
    .dialog .range-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .dialog .range-row .labeled-input {
        width: 100%;
    }

    .dialog .range-row .range-separator {
        display: none;
    }

    .dialog .action-panel {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .dialog .action-panel .action-button,
    .dialog .action-panel .action-item {
        width: 100%;
        min-height: 3rem; /* Larger touch targets on mobile */
    }
}

/* ============================================
   VISUAL POLISH
   ============================================ */

/* Subtle shadow for depth */
.dialog {
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

/* Input placeholder styling */
.dialog input::placeholder {
    color: #aaa;
    font-style: italic;
}

/* Disabled state */
.dialog input:disabled,
.dialog select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Error state */
.dialog input.error,
.dialog select.error {
    border-color: #dc3545;
}

.dialog .error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}
