/* =========================================================================
   LIFEBOOK - MODALS, FORMS & NOTIFICATION STYLES
   ========================================================================= */

/* MODAL OVERLAY */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f0f2f5;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.modal-close-btn:hover {
    background: #e4e6eb;
    color: var(--text-main);
}

.modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: #fafafa;
}

/* FORM CONTROLS INSIDE MODALS */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-col {
    flex: 1;
}

/* Color & Icon Swatches */
.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.emoji-chip-btn {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s;
}

.emoji-chip-btn:hover, .emoji-chip-btn.active {
    background: #e7f3ff;
    border-color: var(--primary);
    transform: scale(1.1);
}

.color-swatch-grid {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.color-swatch-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--border);
    cursor: pointer;
    transition: transform 0.12s;
}

.color-swatch-btn:hover, .color-swatch-btn.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--primary);
}

/* LIGHTBOX PHOTO MODAL */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lightbox-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    color: #ffffff;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.lightbox-close-btn:hover {
    opacity: 1;
}

.lightbox-caption {
    color: #ffffff;
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
}

/* TOAST NOTIFICATION */
.toast-box {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast-box.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-box.success { background: #059669; }
.toast-box.error { background: #dc2626; }
