/* =============================================
   AI PACKING LIST GENERATOR — FRONTEND STYLES
   ============================================= */

.aplg-wrapper {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 820px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 28px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}

.aplg-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--aplg-primary, #2E75B6);
    font-size: 1.4rem;
}

.aplg-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.aplg-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aplg-form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #444;
}

.aplg-form-group input,
.aplg-form-group select {
    padding: 11px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    background: #fafafa;
}

.aplg-form-group input:focus,
.aplg-form-group select:focus {
    outline: none;
    border-color: var(--aplg-primary, #2E75B6);
    background: #fff;
}

.aplg-error-text {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
}

/* BUTTON */
.aplg-btn {
    background: var(--aplg-primary, #2E75B6);
    color: #fff;
    border: none;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}
.aplg-btn svg {
    flex-shrink: 0;
    display: block;
}
.aplg-btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.aplg-btn:hover { opacity: 0.9; }
.aplg-btn:active { transform: scale(0.99); }
.aplg-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.aplg-btn-secondary {
    background: #fff;
    color: var(--aplg-primary, #1a73e8);
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
    border: 2px solid var(--aplg-primary, #1a73e8);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.aplg-btn-secondary svg { flex-shrink: 0; }
.aplg-btn-secondary:hover {
    background: var(--aplg-primary, #1a73e8);
    color: #fff;
    opacity: 1;
}
.aplg-btn-secondary:hover svg { stroke: #fff; }

/* LOADER */
.aplg-loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: aplg-spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes aplg-spin {
    to { transform: rotate(360deg); }
}

/* RESULT PANEL */
.aplg-result-panel {
    margin-top: 28px;
}

.aplg-error-box {
    background: #ffebee;
    color: #c62828;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #c62828;
    font-size: 14px;
}

/* WEATHER CARD */
.aplg-weather-card {
    background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 20px;
    color: #fff;
}

.aplg-weather-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.aplg-weather-location {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.aplg-weather-season {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin-top: 4px;
}

.aplg-weather-condition-badge {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #dde8f5;
    white-space: nowrap;
}

.aplg-weather-metrics {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.aplg-metric-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.aplg-metric-lbl {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.aplg-weather-desc {
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
}

/* DESTINATION NOTE */
.aplg-note-box {
    background: #e8f4fd;
    color: #0d47a1;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #1976d2;
    font-style: italic;
    font-size: 14px;
}

/* CATEGORIES GRID */
.aplg-categories-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .aplg-categories-container { grid-template-columns: 1fr; }
}

.aplg-category-section {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px;
}

.aplg-cat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.aplg-cat-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: rgba(46,117,182,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.aplg-cat-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    flex: 1;
}

.aplg-cat-count {
    font-size: 11px;
    color: #888;
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 10px;
}

.aplg-item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aplg-item-list li {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
    gap: 8px;
}

.aplg-item-list li:last-child { border-bottom: none; }

.aplg-item-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
    gap: 8px;
}

.aplg-item-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--aplg-primary, #2E75B6);
}

.aplg-item-text { font-size: 13px; color: #444; }

.aplg-item-delete {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.aplg-item-delete:hover { color: #e53935; }

/* ACTIONS */
.aplg-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.aplg-powered-by {
    font-size: 11px;
    text-align: right;
    margin-top: 20px;
    color: #aaa;
}

.aplg-powered-by a { color: inherit; text-decoration: underline; }

/* FLOATING WIDGET */
.aplg-floating-widget-wrapper {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999999;
    font-family: system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.aplg-floating-tooltip {
    background: #fff;
    color: #333;
    padding: 12px 30px 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 16px;
    position: relative;
    font-size: 14px;
    font-weight: 500;
    max-width: 250px;
    animation: aplg-fade-up 0.4s ease-out forwards;
    border: 1px solid #eaeaea;
}

.aplg-floating-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 24px;
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.aplg-tooltip-close {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.aplg-tooltip-close:hover { color: #333; }

.aplg-floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--aplg-floating-color, #2E75B6);
    color: #fff;
    border: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    overflow: visible;
    position: relative;
    padding: 0;
}

.aplg-floating-btn:hover { transform: scale(1.08); }

.aplg-floating-btn img.aplg-floating-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.aplg-floating-btn svg {
    width: 28px;
    height: 28px;
    display: block;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    overflow: visible;
}
.aplg-floating-btn.aplg-active svg { transform: rotate(180deg); }

.aplg-floating-panel {
    position: absolute;
    bottom: 80px;
    width: 400px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aplg-fade-up 0.3s ease-out forwards;
}

.aplg-floating-header {
    background: var(--aplg-floating-color, #2E75B6);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aplg-floating-header h4 { margin: 0; font-size: 16px; font-weight: 600; color: #fff; }

.aplg-panel-close { font-size: 24px; cursor: pointer; line-height: 1; opacity: 0.8; }
.aplg-panel-close:hover { opacity: 1; }

.aplg-floating-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.aplg-floating-body .aplg-wrapper {
    max-width: none;
    margin: 0;
    border: none;
    padding: 0;
    box-shadow: none;
}

.aplg-floating-body .aplg-title { display: none; }

.aplg-floating-panel .aplg-form-row { flex-direction: column; gap: 12px; }
.aplg-floating-panel .aplg-categories-container { grid-template-columns: 1fr; }

@keyframes aplg-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .aplg-form-row { flex-direction: column; gap: 10px; }
    .aplg-floating-panel { width: calc(100vw - 48px); left: 0 !important; right: 0 !important; margin: 0 auto; }
}

/* ── DAILY WEATHER STRIP ─────────────────────────────────── */
.aplg-daily-strip {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.aplg-daily-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 10px;
}

.aplg-daily-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.aplg-daily-scroll::-webkit-scrollbar { display: none; }

.aplg-daily-inner {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
    min-width: max-content;
}

.aplg-day-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 8px 10px;
    text-align: center;
    min-width: 62px;
    flex-shrink: 0;
}

.aplg-day-name {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.aplg-day-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 4px;
}

.aplg-day-high {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.aplg-day-low {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
}

.aplg-day-cond {
    font-size: 9px;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 62px;
}

/* ── GENDER TOGGLE ───────────────────────────────────────── */
.aplg-gender-toggle {
    display: flex;
    gap: 0;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.aplg-gender-opt {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    background: #fafafa;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    gap: 6px;
}
.aplg-gender-opt input { display: none; }
.aplg-gender-opt:first-child { border-right: 1px solid #ddd; }
.aplg-gender-opt.active {
    background: var(--aplg-primary, #1a73e8);
    color: #fff;
}

/* ── CALENDAR ────────────────────────────────────────────── */
.aplg-calendar-group { margin-bottom: 16px; }

.aplg-calendar-wrap {
    border: 1.5px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.aplg-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--aplg-primary, #1a73e8);
    color: #fff;
    gap: 8px;
}

.aplg-cal-month-label {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.aplg-cal-nav {
    background: rgba(255,255,255,0.22);
    border: 1.5px solid rgba(255,255,255,0.4);
    color: #fff;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.aplg-cal-nav:hover {
    background: rgba(255,255,255,0.38);
    border-color: rgba(255,255,255,0.7);
}

.aplg-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
}
.aplg-cal-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    padding: 6px 0;
    text-transform: uppercase;
}

.aplg-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 6px;
    gap: 3px;
}

.aplg-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    transition: background 0.1s, color 0.1s;
    border: none;
    background: none;
    width: 100%;
}
.aplg-cal-day:hover:not(.aplg-cal-empty):not(.aplg-cal-past) {
    background: #e8f0fe;
    color: var(--aplg-primary, #1a73e8);
}
.aplg-cal-day.aplg-cal-empty { cursor: default; }
.aplg-cal-day.aplg-cal-past { color: #ccc; cursor: not-allowed; }
.aplg-cal-day.aplg-cal-today { font-weight: 700; color: var(--aplg-primary, #1a73e8); }
.aplg-cal-day.aplg-cal-start {
    background: var(--aplg-primary, #1a73e8);
    color: #fff;
    border-radius: 50% 0 0 50%;
}
.aplg-cal-day.aplg-cal-end {
    background: var(--aplg-primary, #1a73e8);
    color: #fff;
    border-radius: 0 50% 50% 0;
}
.aplg-cal-day.aplg-cal-start.aplg-cal-end { border-radius: 50%; }
.aplg-cal-day.aplg-cal-in-range {
    background: #e8f0fe;
    color: var(--aplg-primary, #1a73e8);
    border-radius: 0;
}

.aplg-cal-selected-info {
    padding: 8px 14px;
    font-size: 13px;
    color: #555;
    border-top: 1px solid #eee;
    min-height: 34px;
    background: #fafafa;
}
