/* =============================================
   AML Lesson Manager — Frontend Styles
   v1.0.5 — full theme isolation
   ============================================= */

:root {
    --aml-primary:   #1a5276;
    --aml-accent:    #c0392b;
    --aml-success:   #27ae60;
    --aml-warning:   #e67e22;
    --aml-light:     #f4f6f7;
    --aml-border:    #dee2e6;
    --aml-text:      #2c3e50;
    --aml-muted:     #7f8c8d;
    --aml-radius:    10px;
    --aml-shadow:    0 2px 12px rgba(0,0,0,0.08);
    --aml-bg:        #ffffff;
}

/* =============================================
   THEME ISOLATION — force light background +
   dark readable text on ALL plugin content
   ============================================= */
.aml-dashboard,
.aml-booking,
.aml-practice-log,
.aml-my-students,
.aml-account-bar,
.aml-lesson-notes-page {
    background-color: #ffffff !important;
    color: #2c3e50 !important;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    border-radius: 8px;
}

/* Force ALL text inside plugin containers to be dark */
.aml-dashboard *,
.aml-booking *,
.aml-practice-log *,
.aml-my-students *,
.aml-lesson-notes-page * {
    color: inherit;
    box-sizing: border-box;
}

.aml-dashboard h1, .aml-dashboard h2, .aml-dashboard h3, .aml-dashboard h4,
.aml-booking h1, .aml-booking h2, .aml-booking h3,
.aml-lesson-notes-page h1, .aml-lesson-notes-page h2, .aml-lesson-notes-page h3 {
    color: #1a3a5c !important;
    margin-top: 0;
}

.aml-dashboard p, .aml-dashboard span, .aml-dashboard label,
.aml-booking p, .aml-booking span, .aml-booking label {
    color: #2c3e50 !important;
}

/* =============================================
   WooCommerce page colour fix
   (My Account, checkout, registration)
   ============================================= */
.woocommerce-account .woocommerce,
.woocommerce-checkout .woocommerce,
.woocommerce-page .woocommerce {
    background: #ffffff !important;
    color: #2c3e50 !important;
    padding: 24px 20px;
    border-radius: 8px;
}

.woocommerce-account .woocommerce *,
.woocommerce-checkout .woocommerce *,
.woocommerce-page .woocommerce * {
    color: #2c3e50 !important;
}

/* WooCommerce form inputs */
.woocommerce-account input,
.woocommerce-account select,
.woocommerce-account textarea,
.woocommerce-checkout input,
.woocommerce-checkout select,
.woocommerce-checkout textarea,
.woocommerce-page input,
.woocommerce-page select,
.woocommerce-page textarea {
    background: #fff !important;
    color: #2c3e50 !important;
    border: 1px solid #ccd3da !important;
    border-radius: 6px !important;
    padding: 9px 12px !important;
    font-size: 14px !important;
}

/* WooCommerce table text */
.woocommerce-account table,
.woocommerce-checkout table,
.woocommerce-page table,
.woocommerce table.shop_table {
    background: #fff !important;
    color: #2c3e50 !important;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    color: #2c3e50 !important;
    border-color: #dee2e6 !important;
}

/* WooCommerce nav tabs */
.woocommerce-MyAccount-navigation ul li a {
    color: #1a5276 !important;
}
.woocommerce-MyAccount-navigation ul li.is-active a {
    color: #fff !important;
    background: #1a5276 !important;
    border-radius: 4px;
}

/* WooCommerce notices */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    color: #2c3e50 !important;
}

/* Registration role field */
.aml-reg-role-field {
    margin: 16px 0;
}
.aml-reg-role-option {
    display: block;
    padding: 14px 16px;
    border: 2px solid #ccd3da;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    background: #fff;
    color: #2c3e50 !important;
    transition: border-color 0.2s, background 0.2s;
}
.aml-reg-role-option:hover {
    border-color: #1a5276;
    background: #f0f6fb;
}
.aml-reg-role-option input[type="radio"] {
    margin-right: 10px;
    accent-color: #1a5276;
}
.aml-reg-role-option strong {
    color: #1a5276 !important;
}

/* ---- Header ---- */
.aml-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 10px;
}
.aml-dashboard__header h2 { margin: 0; color: #1a3a5c !important; }

/* ---- Sections ---- */
.aml-section { margin-bottom: 35px; }
.aml-section h3 {
    font-size: 1.05rem;
    color: #1a5276 !important;
    border-bottom: 2px solid var(--aml-border);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

/* ---- Cards ---- */
.aml-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}
.aml-card {
    background: #fff !important;
    border: 1px solid var(--aml-border);
    border-radius: var(--aml-radius);
    padding: 18px;
    box-shadow: var(--aml-shadow);
}
.aml-card__title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: #1a3a5c !important;
}

/* ---- Buttons ---- */
.aml-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 6px;
    border: 2px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s;
    line-height: 1.4;
}
.aml-btn--primary {
    background: #1a5276 !important;
    color: #fff !important;
    border-color: #1a5276 !important;
}
.aml-btn--primary:hover { background: #154360 !important; color: #fff !important; }
.aml-btn--outline {
    background: transparent !important;
    border-color: #1a5276 !important;
    color: #1a5276 !important;
}
.aml-btn--outline:hover { background: #1a5276 !important; color: #fff !important; }
.aml-btn--danger {
    background: #c0392b !important;
    color: #fff !important;
    border-color: #c0392b !important;
}
.aml-btn--danger:hover { background: #a93226 !important; color: #fff !important; }
.aml-btn--sm { padding: 5px 12px; font-size: 0.82rem; }
.aml-btn--lg { padding: 13px 28px; font-size: 1.05rem; }

/* ---- Notices ---- */
.aml-notice {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #2c3e50 !important;
}
.aml-notice * { color: #2c3e50 !important; }
.aml-notice a { color: #1a5276 !important; text-decoration: underline; }
.aml-notice--info    { background: #d6eaf8 !important; border-left: 4px solid #2e86c1; }
.aml-notice--success { background: #d5f5e3 !important; border-left: 4px solid #27ae60; }
.aml-notice--warning { background: #fef9e7 !important; border-left: 4px solid #e67e22; }
.aml-notice--error   { background: #fadbd8 !important; border-left: 4px solid #c0392b; }

/* ---- Credit pills ---- */
.aml-credit-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.aml-pill {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.aml-pill--active { background: #d5f5e3; color: #1e8449 !important; }
.aml-pill--empty  { background: #f2f3f4; color: #999 !important; }

/* ---- Lesson list ---- */
.aml-lesson-list { display: flex; flex-direction: column; gap: 10px; }
.aml-lesson-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff !important;
    border: 1px solid var(--aml-border);
    border-radius: var(--aml-radius);
    padding: 14px;
    box-shadow: var(--aml-shadow);
    color: #2c3e50 !important;
}
.aml-lesson-item--upcoming { border-left: 4px solid #1a5276; }
.aml-lesson-item--past     { border-left: 4px solid #aaa; opacity: 0.88; }
.aml-lesson-item__date { text-align: center; min-width: 50px; }
.aml-date-day { display: block; font-size: 0.75rem; text-transform: uppercase; color: #7f8c8d !important; }
.aml-date-num { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: #1a3a5c !important; }
.aml-date-mon { display: block; font-size: 0.75rem; color: #7f8c8d !important; }
.aml-lesson-item__info { flex: 1; display: flex; flex-direction: column; }
.aml-lesson-item__info strong { font-size: 1rem; color: #1a3a5c !important; }
.aml-lesson-item__info span   { font-size: 0.85rem; color: #7f8c8d !important; }

/* ---- Notes panel ---- */
.aml-notes-panel {
    background: #f8f9fa !important;
    border: 1px solid var(--aml-border);
    border-top: none;
    border-radius: 0 0 var(--aml-radius) var(--aml-radius);
    padding: 15px 20px;
    margin-top: -10px;
    color: #2c3e50 !important;
}
.aml-notes-content { line-height: 1.7; color: #2c3e50 !important; }

/* ---- Booking ---- */
.aml-booking-step { margin-bottom: 30px; }
.aml-booking-step h3 { font-size: 1rem; color: #1a5276 !important; margin-bottom: 12px; }
.aml-student-picker { display: flex; flex-wrap: wrap; gap: 12px; }
.aml-student-choice { cursor: pointer; }
.aml-student-choice input { display: none; }
.aml-student-choice__inner {
    display: flex; flex-direction: column;
    padding: 14px 18px;
    border: 2px solid var(--aml-border);
    border-radius: var(--aml-radius);
    background: #fff !important;
    color: #2c3e50 !important;
    transition: all 0.2s;
    min-width: 180px;
}
.aml-student-choice input:checked ~ .aml-student-choice__inner {
    border-color: #1a5276;
    background: #eaf3fb !important;
}
.aml-student-choice__name { font-weight: 700; margin-bottom: 6px; color: #1a3a5c !important; }
.aml-no-credits { font-size: 0.8rem; color: #c0392b !important; margin-top: 6px; }
.aml-duration-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.aml-duration-option {
    padding: 12px 20px;
    border: 2px solid var(--aml-border);
    border-radius: var(--aml-radius);
    cursor: pointer;
    font-weight: 700;
    background: #fff !important;
    color: #2c3e50 !important;
    transition: all 0.2s;
    font-size: 1rem;
}
.aml-duration-option:hover, .aml-duration-option.aml-active {
    border-color: #1a5276;
    background: #eaf3fb !important;
    color: #1a5276 !important;
}

/* ---- Slot calendar ---- */
.aml-slot-nav { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.aml-slot-calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.aml-slot-item {
    background: #fff !important;
    border: 2px solid var(--aml-border);
    border-radius: var(--aml-radius);
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    color: #2c3e50 !important;
}
.aml-slot-item:hover, .aml-slot-item.aml-selected {
    border-color: #1a5276;
    background: #eaf3fb !important;
}
.aml-slot-item--taken { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.aml-slot-date { font-size: 0.8rem; color: #7f8c8d !important; }
.aml-slot-time { font-size: 1.1rem; font-weight: 700; color: #1a3a5c !important; }
.aml-slot-dur  { font-size: 0.8rem; color: #7f8c8d !important; }
.aml-confirm-box {
    background: #fff !important;
    border: 1px solid var(--aml-border);
    border-radius: var(--aml-radius);
    padding: 20px;
    margin-bottom: 20px;
    max-width: 400px;
    color: #2c3e50 !important;
}
.aml-confirm-box p { margin: 6px 0; color: #2c3e50 !important; }

/* ---- Account bar ---- */
.aml-account-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--aml-border);
    background: transparent;
}
.aml-account-bar__user { font-size: 0.9rem; color: #2c3e50 !important; }

/* ---- Cancellation / deactivation modal ---- */
.aml-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.aml-modal-overlay.active { display: flex; }
.aml-modal {
    background: #fff !important;
    border-radius: var(--aml-radius);
    padding: 30px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    color: #2c3e50 !important;
}
.aml-modal h3 { margin: 0 0 14px; color: #1a3a5c !important; }
.aml-modal p  { color: #555 !important; }
.aml-modal select,
.aml-modal textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccd3da;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    background: #fff !important;
    color: #2c3e50 !important;
}
.aml-modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---- Misc ---- */
.aml-muted      { color: #7f8c8d !important; font-size: 0.9rem; }
.aml-loading    { padding: 30px; text-align: center; color: #7f8c8d !important; }
.aml-low-warning { font-size: 0.85rem; color: #e67e22 !important; margin-top: 8px; }

/* ---- Stats ---- */
.aml-stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.aml-stat-box {
    background: #fff !important;
    border: 1px solid var(--aml-border);
    border-radius: var(--aml-radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--aml-shadow);
}
.aml-stat-box__num   { display: block; font-size: 1.8rem; font-weight: 700; color: #1a5276 !important; line-height: 1.1; }
.aml-stat-box__label { display: block; font-size: 0.78rem; color: #7f8c8d !important; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Form rows ---- */
.aml-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.aml-form-row label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; color: #2c3e50 !important; }
.aml-form-row input, .aml-form-row select, .aml-form-row textarea {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--aml-border);
    border-radius: 6px; font-size: 0.95rem;
    background: #fff !important; color: #2c3e50 !important;
}

/* ---- Practice log ---- */
.aml-mood-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.aml-mood-option { cursor: pointer; }
.aml-mood-option input { display: none; }
.aml-mood-option span.aml-mood-emoji { display: block; font-size: 2rem; text-align: center; transition: transform 0.2s; }
.aml-mood-option input:checked ~ .aml-mood-emoji { transform: scale(1.3); }
.aml-mood-label { display: block; font-size: 0.75rem; text-align: center; color: #7f8c8d !important; margin-top: 2px; }
.aml-practice-entry {
    display: flex; align-items: flex-start; gap: 15px;
    background: #fff !important; border: 1px solid var(--aml-border);
    border-radius: var(--aml-radius); padding: 14px; margin-bottom: 10px;
    box-shadow: var(--aml-shadow); color: #2c3e50 !important;
}
.aml-practice-entry__date  { text-align: center; min-width: 50px; font-size: 0.85rem; color: #7f8c8d !important; font-weight: 700; }
.aml-practice-entry__info  { flex: 1; }
.aml-practice-entry__duration { font-weight: 700; font-size: 1rem; color: #1a3a5c !important; }
.aml-practice-entry__notes { margin: 6px 0 0; font-size: 0.9rem; color: #7f8c8d !important; }

@media (max-width: 600px) {
    .aml-form-row { grid-template-columns: 1fr; }
    .aml-stats-row { grid-template-columns: 1fr 1fr; }
    .aml-dashboard__header { flex-direction: column; align-items: flex-start; }
}

/* =============================================
   WOOCOMMERCE LOGIN / PASSWORD RESET FIXES
   Targets: My Account, Lost Password, Reset Password
   ============================================= */

/* Force all WooCommerce account page links to dark blue (not light green) */
.woocommerce-account a,
.woocommerce-page a,
.woocommerce-checkout a,
.woocommerce-account .woocommerce-LostPassword a,
.woocommerce-account .woocommerce-form__label a {
    color: #1a3a5c !important;
    text-decoration: underline !important;
}
.woocommerce-account a:hover,
.woocommerce-page a:hover {
    color: #2980b9 !important;
}

/* Password / text input visibility fix — Divi sometimes makes these white-on-white */
.woocommerce-account input[type="text"],
.woocommerce-account input[type="email"],
.woocommerce-account input[type="password"],
.woocommerce-account input[type="tel"],
.woocommerce-page input[type="text"],
.woocommerce-page input[type="email"],
.woocommerce-page input[type="password"],
.lost_password input[type="text"],
.lost_password input[type="email"],
body.woocommerce-page input[type="password"] {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border: 1px solid #aab2bd !important;
    border-radius: 4px !important;
    padding: 10px 12px !important;
    font-size: 15px !important;
    -webkit-text-fill-color: #1a1a1a !important; /* overrides Divi/browser autofill */
    opacity: 1 !important;
}

/* Login / register form labels */
.woocommerce-account label,
.woocommerce-page label,
.woocommerce-form label {
    color: #2c3e50 !important;
}

/* Navigation / sidebar links in My Account */
.woocommerce-account .woocommerce-MyAccount-navigation a {
    color: #1a3a5c !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
    color: #2980b9 !important;
    font-weight: 700;
}

/* Password strength meter text */
.woocommerce-password-strength {
    color: #2c3e50 !important;
}

/* "Return to shop" and other utility links */
.woocommerce a.button,
.woocommerce-page a.button,
.woocommerce button.button {
    background-color: #1a3a5c !important;
    color: #ffffff !important;
    border-radius: 5px !important;
    padding: 10px 20px !important;
}
.woocommerce a.button:hover,
.woocommerce-page a.button:hover {
    background-color: #2980b9 !important;
    color: #ffffff !important;
}

/* =============================================
   BOOKING CALENDAR - date-only with time popup
   ============================================= */
.aml-slot-item {
    position: relative;
}
.aml-slot-time-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a3a5c;
    color: #fff !important;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.aml-slot-time-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #1a3a5c;
    border-top: none;
}
.aml-slot-item:hover .aml-slot-time-popup,
.aml-slot-item.aml-selected .aml-slot-time-popup {
    display: block;
}

/* Slot calendar — date-only card */
.aml-slot-date-only {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a3a5c !important;
    margin-bottom: 2px;
}
.aml-slot-date-weekday {
    font-size: 0.75rem;
    color: #7f8c8d !important;
    text-transform: uppercase;
}
