/* Public/client portal styles for LLT Legal & Tax Services plugin */

/* Colour palette */
:root {
    /* Core palette from the UI/UX specification.  These variables
     * ensure consistency across the public portal and mirror the
     * admin palette.  Colours maintain at least a 4.5:1 contrast
     * ratio on light backgrounds【659244416914242†L49-L147】.
     */
    --color-primary: #0F4C81;
    --color-secondary: #1F6F8B;
    --color-accent: #00A86B;
    --color-danger: #D64541;
    --color-warning: #F5A623;
    --color-info: #008EAA;
    --color-light: #F7FAFC;
    --color-dark: #1A202C;
    --spacing: 8px;
    --radius: 6px;
    --transition: 0.3s ease;

    /* Legacy LLT variables mapped to new palette for backwards
     * compatibility. These are used by existing markup and should
     * remain until all templates adopt the new classes. */
    --llt-primary: var(--color-primary);
    --llt-success: var(--color-accent);
    --llt-warning: var(--color-warning);
    --llt-danger: var(--color-danger);
    --llt-info: var(--color-info);
    --llt-light-bg: var(--color-light);
    --llt-border: #e1e7ec;
    --llt-text: var(--color-dark);
    --llt-muted: #6c757d;
}

/* Base portal container styling */
.llt-portal {
    margin: 20px 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--llt-text);
    background-color: var(--llt-light-bg);
    line-height: 1.6;
}

.llt-portal h2 {
    margin-top: 0;
    color: #0073aa;
}

.llt-summary {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 20px;
}
.llt-summary li {
    background: #f0f8ff;
    border: 1px solid #dde6ee;
    padding: 15px;
    border-radius: 4px;
    min-width: 120px;
}

.llt-summary strong {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--llt-primary);
}

/* Status badges */
.llt-status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #fff;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.2;
}
.llt-status-initiated { background: var(--llt-primary); }
.llt-status-in_progress { background: var(--llt-info); }
.llt-status-under_review { background: var(--llt-warning); color: #212529; }
.llt-status-completed { background: var(--llt-success); }
.llt-status-missing { background: var(--llt-danger); }
.llt-status-uploaded { background: var(--llt-info); }
.llt-status-verified { background: var(--llt-warning); color: #212529; }
.llt-status-approved { background: var(--llt-success); }
.llt-status-used { background: var(--llt-success); }
.llt-status-rejected { background: var(--llt-danger); }

/* Additional call status badges */
.llt-status-scheduled { background: var(--llt-info); }
.llt-status-confirmed { background: var(--llt-success); }
/* Use a dark text colour for warning backgrounds to ensure contrast */
.llt-status-reschedule_requested { background: var(--llt-warning); color: #212529; }
.llt-status-cancelled { background: var(--llt-danger); }

/* Progress bar for public views */
.llt-progress-bar {
    width: 100%;
    background: var(--llt-border);
    border-radius: 4px;
    height: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}
.llt-progress-bar span {
    display: block;
    height: 100%;
    background: var(--llt-primary);
    transition: width 0.4s ease;
}
.llt-progress-label {
    font-weight: 600;
    font-size: 14px;
}

/* Generic table styling */
.llt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.llt-table th, .llt-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
}
.llt-table thead th {
    background: #f8f8f8;
    text-align: left;
    font-weight: 600;
}
.llt-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* ------------------------------------------------------------------
 * Messaging styles (public portal)
 *
 * These styles make conversations pleasant to read for clients. They
 * differentiate between messages sent by the client (you) and by the
 * firm using colour and alignment. A generic badge style is provided
 * for unread counts in the conversation list.
 */

.llt-messages {
    margin-top: 20px;
}

.llt-messages-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.llt-messages-list li {
    padding: 10px 12px;
    border: 1px solid var(--llt-border);
    border-radius: 6px;
    max-width: 600px;
}

/* Firm/admin message bubble (received by client) */
.llt-messages-list li.llt-msg-admin {
    background: #eef7fc;
    align-self: flex-start;
}

/* Client’s own message bubble */
.llt-messages-list li.llt-msg-client {
    background: #fef6e7;
    align-self: flex-end;
}

.llt-msg-header {
    font-size: 12px;
    color: var(--llt-muted);
    margin-bottom: 4px;
}

.llt-msg-body {
    font-size: 14px;
    color: var(--llt-text);
}

/* Badge styles for unread counts */
.llt-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
}

.llt-badge-danger {
    background: var(--llt-danger);
}

.llt-badge-warning {
    background: var(--llt-warning);
    color: #212529;
}

.llt-badge-success {
    background: var(--llt-success);
}

/* ==================================================================
 * New component styles for the public/client portal
 *
 * These classes align the public interface with the UI/UX
 * specification【659244416914242†L312-L520】, providing reusable
 * components for buttons, forms, cards, lists, toasts, toggles and
 * modals. They share the same palette and spacing as the admin
 * interface.
 */

/* Buttons */
.llt-btn {
    display: inline-block;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    padding: 8px 16px;
    cursor: pointer;
    text-align: center;
    transition: background-color var(--transition), color var(--transition);
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none;
}
.llt-btn--primary {
    background-color: var(--color-primary);
    color: #fff;
}
.llt-btn--primary:hover {
    background-color: #0c3d66;
}
.llt-btn--secondary {
    background-color: var(--color-secondary);
    color: #fff;
}
.llt-btn--secondary:hover {
    background-color: #165870;
}
.llt-btn--accent {
    background-color: var(--color-accent);
    color: #fff;
}
.llt-btn--accent:hover {
    background-color: #008053;
}
.llt-btn--danger {
    background-color: var(--color-danger);
    color: #fff;
}
.llt-btn--danger:hover {
    background-color: #b83833;
}
.llt-btn--warning {
    background-color: var(--color-warning);
    color: #212529;
}
.llt-btn--warning:hover {
    background-color: #d48f1c;
}
.llt-btn--info {
    background-color: var(--color-info);
    color: #fff;
}
.llt-btn--info:hover {
    background-color: #006d86;
}

/* Forms */
.llt-form-group {
    margin-bottom: calc(var(--spacing) * 2);
}
.llt-form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--llt-text);
}
.llt-form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--llt-border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--llt-text);
    background-color: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.llt-form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(15, 76, 129, 0.2);
}
.llt-form-control.error {
    border-color: var(--color-danger);
}
.llt-form-error {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: 4px;
}

/* Cards */
.llt-card {
    background-color: var(--color-light);
    border: 1px solid var(--llt-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* ------------------------------------------------------------------
 * Front‑end Admin Portal Styles
 *
 * The admin portal is rendered on the front‑end using the plugin’s
 * custom login system.  These styles define a horizontal navigation
 * bar, metric cards and section containers.  Colours and spacing
 * mirror the core palette and maintain good contrast.  Additional
 * classes for form controls, tables and buttons are already defined
 * elsewhere in this file, so the admin portal reuses those for
 * consistency.
 */

/* Navigation bar for the admin portal */
.llt-admin-nav {
    margin: 20px 0;
}
.llt-admin-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
}
.llt-admin-nav li a {
    display: block;
    padding: 8px 16px;
    border-radius: var(--radius);
    background-color: var(--color-secondary);
    color: #fff;
    text-decoration: none;
    transition: background-color var(--transition);
}
.llt-admin-nav li.active a {
    background-color: var(--color-primary);
}
.llt-admin-nav li a:hover {
    background-color: var(--color-accent);
}

/* Container for admin portal sections */
.llt-admin-portal {
    margin-top: 20px;
}

/* Metric cards for admin dashboard */
.llt-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}
.llt-metric {
    flex: 1;
    min-width: 150px;
    background: var(--color-light);
    border: 1px solid var(--llt-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.llt-metric h3 {
    margin: 0 0 5px;
    font-size: 28px;
    color: var(--color-primary);
}
.llt-metric span {
    font-size: 14px;
    color: var(--llt-muted);
}
.llt-card-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-dark);
}
.llt-card-content {
    font-size: 14px;
    color: var(--llt-text);
}

/* Lists */
.llt-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.llt-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--llt-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--llt-text);
}
.llt-list-item:nth-child(even) {
    background-color: #ffffff;
}
.llt-list-item:nth-child(odd) {
    background-color: #f6f8fa;
}

/* Toast notifications */
.llt-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    min-width: 250px;
    max-width: 350px;
    padding: 16px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
}
.llt-toast.toast-success { background-color: var(--color-accent); }
.llt-toast.toast-danger { background-color: var(--color-danger); }
.llt-toast.toast-warning { background-color: var(--color-warning); color: #212529; }
.llt-toast.toast-info { background-color: var(--color-info); }

/* Toggle switch */
.llt-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.llt-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.llt-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--llt-muted);
    transition: 0.4s;
    border-radius: 24px;
}
.llt-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}
.llt-toggle input:checked + .llt-slider {
    background-color: var(--color-accent);
}
.llt-toggle input:checked + .llt-slider:before {
    transform: translateX(20px);
}

/* ------------------------------------------------------------------
 * Portal Navigation
 *
 * A horizontal menu that appears at the top of each portal page. It
 * uses the primary palette for the background and highlights the
 * active section using the secondary colour. Links are white by
 * default to maintain contrast. Site owners should adjust the
 * markup/links in PHP if their portal pages use different URLs.
 */
.llt-portal-nav {
    background-color: var(--color-primary);
    padding: 10px 20px;
    margin-bottom: 20px;
}
.llt-portal-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.llt-portal-nav li {
    margin: 0;
}
.llt-portal-nav a {
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-weight: 600;
    display: block;
    transition: background-color var(--transition);
}
.llt-portal-nav li.active a {
    background-color: var(--color-secondary);
}
.llt-portal-nav a:hover {
    background-color: var(--color-secondary);
}
/* Modal backdrop and dialog */
.llt-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 999;
}
.llt-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 500px;
    width: 90%;
    z-index: 1000;
    display: none;
}
.llt-modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-dark);
}
.llt-modal-content {
    font-size: 14px;
    color: var(--llt-text);
    margin-bottom: 20px;
}
.llt-modal-actions {
    text-align: right;
}

/* ------------------------------------------------------------------
 * Client Portal Navigation
 *
 * The client portal uses a horizontal navigation bar on structured pages
 * (Dashboard, Cases & Checklists, Documents & Payments, Messages & Calendar,
 * Resources & Tools, Team Management).  These styles mirror the admin nav
 * palette but use the secondary colour as the default background and
 * primary colour for the active state.  Links are displayed inline with
 * spacing and wrap on small screens.  Mobile responsiveness is achieved
 * by allowing items to wrap naturally and by using consistent padding.
 */
.llt-client-nav {
    margin: 20px 0;
}
.llt-client-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.llt-client-nav li a {
    display: block;
    padding: 8px 16px;
    border-radius: var(--radius);
    background-color: var(--color-secondary);
    color: #fff;
    text-decoration: none;
    transition: background-color var(--transition);
}
.llt-client-nav li.active a {
    background-color: var(--color-primary);
}
.llt-client-nav li a:hover {
    background-color: var(--color-accent);
}