/* ==========================================================================
   MODALS.CSS - Modal and Tooltip Styles
   ========================================================================== */

/* TOOLTIPS (Acronyms) */
.tooltip-term {
    border-bottom: 1px dotted var(--accent-gold);
    cursor: help;
    position: relative;
    color: var(--primary-blue);
    font-weight: 500;
}

.tooltip-term:hover {
    color: var(--accent-gold);
}

.tooltip-term::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-navy);
    color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.tooltip-term:hover::after {
    opacity: 1;
}

/* MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 2003;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* MODAL CONTAINER */
.tool-modal {
    background: var(--surface-white);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.open .tool-modal {
    transform: translateY(0);
}

/* MODAL HEADER */
.modal-header {
    background: var(--bg-off-white);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-main);
}

/* MODAL BODY */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-main);
}

/* CALCULATOR STYLES */
.calc-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.calc-input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-off-white);
    color: var(--text-main);
    font-family: inherit;
}

.calc-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.bilateral-check-wrapper {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.bilateral-check-wrapper input[type="checkbox"] {
    accent-color: var(--primary-blue);
}

.calc-add-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 8px;
    cursor: pointer;
    height: 42px;
    font-weight: 600;
    transition: background 0.2s;
}

.calc-add-btn:hover {
    background: #1e3a8a;
}

.rating-list {
    list-style: none;
    margin-bottom: 1.5rem;
    min-height: 50px;
    border: 1px dashed var(--border-subtle);
    border-radius: 8px;
    padding: 0.5rem;
}

.rating-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.rating-item:last-child {
    border-bottom: none;
}

.rating-item.bilateral-item {
    background: rgba(30, 64, 175, 0.05);
    color: var(--primary-blue);
    border-radius: 4px;
}

.calc-result {
    background: var(--bg-off-white);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.result-big {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-blue);
    display: block;
}

/* CHECKLIST STYLES */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.2s;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover {
    background: var(--bg-off-white);
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--success-green);
    cursor: pointer;
}

.checklist-label {
    font-size: 0.95rem;
    cursor: pointer;
    flex: 1;
}

.checklist-item.checked .checklist-label {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Reset Button Styles */
.reset-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    border: 1px solid var(--alert-red);
    background: none;
    color: var(--alert-red);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: var(--alert-red);
    color: white;
}

.reset-btn-muted {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.reset-btn-muted:hover {
    background: var(--text-muted);
    color: white;
}

/* ==========================================================================
   FORM STYLES (Report Modal)
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-off-white);
    color: var(--text-main);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: #1e3a8a;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-off-white);
    border-color: var(--text-muted);
}

/* ==========================================================================
   PUSH NOTIFICATION STYLES
   ========================================================================== */

.push-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-off-white);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.push-status-badge {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    background: var(--border-subtle);
    color: var(--text-muted);
}

.push-status-badge.enabled {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success-green);
}

.push-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.push-toggle-btn {
    width: 100%;
}

.push-toggle-btn.subscribed {
    background: var(--alert-red);
}

.push-toggle-btn.subscribed:hover {
    background: #dc2626;
}

.push-ios-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--warning-text);
}

.push-ios-note i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.push-toast,
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-navy);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.push-toast.show,
.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
