/* ACT Waze v4 — Crowdsourced Data Intelligence System
   Dynamic action buttons with toolbar layout, label plinths, and click-based tooltips
   86 actions across 14 categories */

/* Container that wraps the comment textarea */
.act-waze-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Toolbar — horizontal row of action buttons above the textarea */
.act-waze-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(26, 26, 46, 0.04);
    border: 1px solid rgba(26, 26, 46, 0.08);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    min-height: 56px;
    align-items: flex-start;
}

/* Individual action button — now a column layout with icon + plinth label */
.act-waze-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.4);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    position: relative;
    padding: 4px 2px;
    gap: 3px;
    min-width: 52px;
    max-width: 70px;
    border-radius: 8px;
    border: none;
    background: none;
}

.act-waze-btn.visible {
    opacity: 1;
    transform: scale(1);
}

/* Icon circle */
.act-waze-btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(30, 30, 50, 0.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
    line-height: 1;
}

.act-waze-btn.primary .act-waze-btn-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

/* Plinth label under the icon */
.act-waze-btn-plinth {
    font-size: 9px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    line-height: 1.15;
    letter-spacing: 0.2px;
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.act-waze-btn:hover .act-waze-btn-plinth,
.act-waze-btn.tooltip-open .act-waze-btn-plinth {
    opacity: 1;
}

/* Hover and active states */
.act-waze-btn:hover .act-waze-btn-icon {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.act-waze-btn.tooltip-open .act-waze-btn-icon {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Urgency colour coding — applied to the icon circle */
.act-waze-btn.urgency-critical .act-waze-btn-icon {
    border-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}
.act-waze-btn.urgency-critical.visible .act-waze-btn-icon {
    animation: waze-pulse-red 2s ease-in-out infinite;
}
.act-waze-btn.urgency-critical .act-waze-btn-plinth { color: #c0392b; }

.act-waze-btn.urgency-high .act-waze-btn-icon {
    border-color: #e67e22;
    box-shadow: 0 0 6px rgba(230, 126, 34, 0.3);
}
.act-waze-btn.urgency-high .act-waze-btn-plinth { color: #d35400; }

.act-waze-btn.urgency-medium .act-waze-btn-icon {
    border-color: #3498db;
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.3);
}
.act-waze-btn.urgency-medium .act-waze-btn-plinth { color: #2980b9; }

.act-waze-btn.urgency-low .act-waze-btn-icon {
    border-color: #27ae60;
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.3);
}
.act-waze-btn.urgency-low .act-waze-btn-plinth { color: #1e8449; }

.act-waze-btn.urgency-intel .act-waze-btn-icon {
    border-color: #9b59b6;
    box-shadow: 0 0 6px rgba(155, 89, 182, 0.3);
}
.act-waze-btn.urgency-intel .act-waze-btn-plinth { color: #7d3c98; }

/* Pulse animation for critical buttons */
@keyframes waze-pulse-red {
    0%, 100% { box-shadow: 0 0 8px rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 16px rgba(231, 76, 60, 0.7); }
}

/* Dynamic tooltip panel — sits below the textarea, click-activated */
.act-waze-tooltip-panel {
    background: rgba(26, 26, 46, 0.97);
    color: #fff;
    padding: 14px 18px;
    border-radius: 0 0 10px 10px;
    border: 1px solid rgba(26, 26, 46, 0.15);
    border-top: none;
    font-size: 13px;
    line-height: 1.5;
    transition: all 0.25s ease;
}

.act-waze-tooltip-panel .tooltip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    margin-bottom: 6px;
}

.act-waze-tooltip-panel .tooltip-header strong {
    font-size: 14px;
    flex: 1;
}

.act-waze-tooltip-panel .tooltip-urgency {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.act-waze-tooltip-panel .tooltip-desc {
    margin: 4px 0;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
}

.act-waze-tooltip-panel .tooltip-context {
    margin: 6px 0 4px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-style: italic;
}

/* Tooltip action buttons — submit and close */
.act-waze-tooltip-panel .tooltip-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.act-waze-tooltip-panel .tooltip-submit-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.act-waze-tooltip-panel .tooltip-submit-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.act-waze-tooltip-panel .tooltip-close-btn {
    padding: 7px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.act-waze-tooltip-panel .tooltip-close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Action form modal overlay */
.act-waze-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.act-waze-form-overlay.show {
    opacity: 1;
}

/* Form card */
.act-waze-form {
    background: #fff;
    border-radius: 16px;
    width: 520px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: waze-form-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes waze-form-in {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.act-waze-form-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.act-waze-form-header .icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.act-waze-form-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.act-waze-form-header p {
    margin: 4px 0 6px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.act-waze-form-header .urgency-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-right: 6px;
}

.act-waze-form-header .category-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f4f8;
    color: #555;
    letter-spacing: 0.3px;
}

/* Change request notice */
.change-request-notice {
    background: #f0f8ff;
    border: 1px solid #d0e8ff;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.change-request-notice strong {
    font-size: 13px;
    color: #1a5276;
}

.change-request-notice p {
    margin: 4px 0 0;
    font-size: 11px;
    color: #2c6fa0;
    line-height: 1.4;
}

/* Form body */
.act-waze-form-body {
    padding: 20px 24px;
}

.act-waze-form-body .field-group {
    margin-bottom: 14px;
}

.act-waze-form-body label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.act-waze-form-body input,
.act-waze-form-body textarea,
.act-waze-form-body select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.act-waze-form-body input:focus,
.act-waze-form-body textarea:focus,
.act-waze-form-body select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.act-waze-form-body .ai-prefilled {
    background: #f0f8ff;
    border-color: #3498db;
}

.act-waze-form-body .ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Form footer */
.act-waze-form-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.act-waze-form-footer button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.act-waze-form-footer .btn-cancel {
    background: #f0f0f0;
    color: #555;
}

.act-waze-form-footer .btn-cancel:hover {
    background: #e0e0e0;
}

.act-waze-form-footer .btn-submit {
    color: #fff;
}

.act-waze-form-footer .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.act-waze-form-footer .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Confirmation toast */
.act-waze-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #27ae60;
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(39, 174, 96, 0.3);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.act-waze-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ACT Waze badge on the comment textarea */
.act-waze-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.act-waze-badge.active {
    background: linear-gradient(135deg, #1a5276, #2c6fa0);
    box-shadow: 0 2px 8px rgba(44, 111, 160, 0.3);
}

.act-waze-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #27ae60;
    animation: waze-dot-pulse 1.5s ease-in-out infinite;
}

.act-waze-badge .action-count {
    font-size: 9px;
    opacity: 0.8;
}

@keyframes waze-dot-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Scrollbar for form */
.act-waze-form::-webkit-scrollbar {
    width: 6px;
}
.act-waze-form::-webkit-scrollbar-track {
    background: transparent;
}
.act-waze-form::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
